gbAnimator - Animation|
Animation is simply movement of a model as a result of forces applied. In
gbAnimator, there are four sources of forces - global properties (gravity
and wind), animators, gravity nodes and rotation nodes.
Global Properties - Gravity
Gravity is simply a force which pulls the models downward to the floor.
A model is typically in above the floor of the display area. When animation is
started, the model drops to the bottom of the display area. It may collapse
or bounce around depending on the stability of the model.
Gravity in gbAnimator may also be set to zero, or to negative values which will
draw models to the top of the display area.
There are two other global settings which work with gravity to affect how a
model drops, bounces and comes to rest.
- Friction - when a mass comes in contact with a floor, it losses a fraction of
its velocity in the X-direction.
- Bounce - when a mass comes in contact with the floor, it reverses it's Y-direction
motion and losses a fraction of its velocity in the Y-direction
Global Properties - Wind
Wind forces are also supported in gbAnimator. Winds may be horizontal from the left
or horizontal from the right.
An animator link is probably the most interesting aspect of gbAnimator.
Animator links are simply links which exert a force on the nodes at each end of the link.
The magnitude of the force varies over time between pushing on the nodes and pulling on
the nodes. The result of the animator's push/pull forces on connected masses attached
to the link is that the length of the link grows and shrinks. The strength of the
push/pull, how often it repeats, and the timing between animator links can be adjusted
by the user.
By putting multiple animators in a model, and by timing the animation of each, an
entire model can be made to move - simple robots or complex creations which walk/roll/bounce
across the screen.
The Angle property of animators is the key to creating self-animated models.
The push/pull of animators follows a simple sine wave pattern - oscillating between a
maximum value (push) and a minimum value (pull).
The time at which an animator starts its push/pull cycle can be adjusted
by setting the angle (sometimes called the phase angle) property, with
values from 0 to 360 degress. Animation of an entire model can be created
by including several animator links in a model and adjusting the timing
(angle) of the links to create animation effects of walking, rolling or hopping.
Several of the models distributed with gbAnimator demonstrate these concepts.
Animation of a model can be set to include, or exclude, the effects of animators.
There are also three time-related global settings which affect the speed of gbAnimator animation.
- Time Interval (t) - The equations of motion in response to a force include
a time variable. In general, the smaller the time interval the smoother the
motion appears to be.
- Repetition Rate (r) - gbAnimator can animate a scene at faster than real time
speeds. It does so by repeating the calculations for a time interval more
frequently than the time interval itself.
- Animation Clock (c) - The frequency of the push/pull of the animators can
be adjusted to achieve faster or slower animation. Generally, animators
operate fairly slowly (1-5 oscillations per second).
To simplify managing the phase angles associated with animator links, gbAnimator
provides an optionally displayed Phase Manager.
Once a link is activated as an animator, it will automatically appear in the
Phase Manager, positioned according to the angle assigned to it. The animator
is represeneted by a dot with the link number appearing beside it. Animator link
phase angles can be changed by simply dragging the dots to a new angle position.
gbAnimator automatically lines up animator dots which have the same angle.
If the toolbar snap-to-grid button is pressed, dots move with a mouse will move
in 22.5 degree increments. If the snap-to-grid button is not pressed, dots may
be moved to any angle value.
If a link is selected in the gbAnimator display, its dot will be colored blue.
All other animator link dots are black.
The red sine wave shown in the Phase Manager moves left/right during animation. When it
reaches a peak at an angle, animator links with that angle setting will achieve
their maximum extension.
A node may be given the property of gravitational attraction, whereby
it attracts all other nodes in the model. As in the real world, the force of attraction is
proportional to the inverse square of the distance between the gravity node and the
nodes attracted to it.
A node may be assigned a rotational force which is applied to all other nodes connected to it.
Note that rotational nodes apply a force, not a velocity, to connected nodes.
This means that closer nodes will experience greater velocities than nodes connected
with longer links - just as expected in real life physics!