HTML5 Canvas 2D Library
 

Motion

taccgl™ currently supports a motion from one point to another with constant acceleration and simultanously a rotation around a given point and axis (without acceleration).

The simplest and most common case is a linear motion from one point to another along a straight line with a fixed velocity. This is a motion without (or with zero) acceleration, the object's velocity does not change i.e. the object does not get faster or slower during the transition.

taccgl™ provides methods to specify the starting and end point of the motion (e.g. from, to, flyHome). Default is the position of the animated HTML element. So as long as none of the methods are used the object stays stationary, if only from is used it moves from the given point to the position of the HTML element, if only to is used it moves away from the position of the HTML element and if both are used begin and end of the motion can be specified explicitely.

For rotations taccgl™ provides methods to specify axis and center point rotate, rotateMiddle.

In addition taccgl™ supports an animation from one point to another with a constant acceleration. I.e. the object gets slower or faster (depending on the direction of the acceleration) during the transition. The acceleration is constant, so the object get faster/slower at the same rate throughout the transition. This is typically used for animations wherein the object slowly starts to move or where an object becomes slower and slower until it finally stops. taccgl™ provides methods to specify the velocity of the object either at the beginning or the end of the animation (vBegin and vEnd). Typlically one would specify a zero velocity at the begin for an object that slowly starts to move. There are also methods to set the acceleration explicitely (acceleration, scalarAcceleration).

The acceleration and the velocities are, however, vectors having a direction and so transitions necessarily perform linear motions along a straight line but can also have a parabolic trajectory. This happens if the acceleration does not have the direction (or the reverse direction) of the line between starting and end point.

Note that more complex motions can be done by connecting multiple transitions.

Next Page:Textures
Previous Page: Time and Duration