<- previous    index    next ->

Lecture 13, Motion and movement


When using motion, dynamics, in your GUI, think about what
you want to convey.

Russian Fighter, manuvers

 Bears fall down, move mouse

Two choices are cartoon or realism.

The choice of cartoon allows you to violate the laws of
physics. You can squash, stretch and make objects fly
and stop instantaneously. This can be very effective
to impress the viewer.

In order to get realism, the motion needs to approximate
the real world laws of physics. In the simplest terms:
   dt is the time for one screen update
   ds is the distance moved for one screen update
   dv is the change in velocity for one screen update

   s is the objects position (may have 1, 2 or 3 components, x,y,z)
   v is the objects velocity (may have 1, 2 or 3 components)
   a is the acceleration of the object        ( " )
   m is the mass of the object
   f is the force being applied to the object ( " )

Then, given a force, f, compute for each screen:

   a  = f / m     (may have 1, 2 or 3 components)
   dv = a * dt
   v  = v + dv
   ds = v * dt
   s  = s + ds

For a complete set of physics equations and related information
see click on last item, Physics Equations



The short clip, Flatland, is intended to get you thinking about how
people will view your GUI.
Put yourself in the local characters position - what do you see?
Put yourself in the outside observers position - what do you see?

clip Flatland

Notice how Flatlanders move around. like us, they face front
when walking, running, driving. Yet, flip in two dimensions.



Observe the trailers. Do you notice any violations of the laws
of physics? This will be intuitive from your life experience,
not from trying to mentally compute equations.

Note body shape, good for fast rendering of graphics.

the incredibles trailer

Are these cars obeying the laws of physics?
Wall-E trailer

Then, simulation of a construction process. Not real time.
Used to check assembly sequence. The International Space Station,
iss

No gravity International Space Station.
iss

Your project should have either manual, user, speed control or
automatic speed control using clock or some other timing.
Do not expect to get the super performance of movies, unless
you are using a graphics tool kit that uses the graphics card
processor in a near optimum way.


    <- previous    index    next ->

Other links

Many web sites on Java GUI, AWT, Swing, etc.
Many web sites on Python wx, tk, qt, etc.

Go to top