Animation paths have different modes which specify the nature of the interpolation between points. The scale, position, and orientation modes can all be set for the entire path or for individual control points.
The two interpolation modes are linear or cubic bezier. Linear interpolation is, as it sounds, a direct and uniform interpolation between the control points. The cubic bezier mode uses the tangents in and out of the control points to construct a smooth path between control points that going through each of them. The <animationpath>.computeTangents command will automatically compute tangents for the control points on a path, or you can work with individual control point tangents with the <controlpoint>.setPositionIn and <controlpoint>.setPositionOut commands.
You can also apply automatic rotations to a control path (<animationpath>.setAutoRotate). With automatic rotations, objects traveling along the path will stay pointed down the paths trajectory. Applying automatic rotations will override whatever rotations are specified at individual control points.
Animation paths also support the ability to move along the path at a constant speed. The <animationpath>.setConstantSpeed command allows enabling constant speed movement and specifying the constant velocity. When constant speed is enabled, the control point times are ignored, however they are still used to specify the ordering of the points along the path.
Interpolation modes
Argument |
Description |
viz.LINEAR |
Interpolate linearly between control points. |
viz.CUBIC_BEZIER |
Use cubic bezier interpolation. Cubic bezier uses the control points and their incoming and outgoing tangents to compute a smooth curve between them. This is normally only used with translations. |
Interpolation modes for individual control points
Mode |
Description |
viz.INHERIT |
Inherit the interpolation mode of the animation path. (Default) |
viz.LINEAR |
Interpolate linearly for this control point. |
viz.CUBIC_BEZIER |
Use cubic bezier interpolation. Cubic bezier uses the control points and their incoming and outgoing tangents to compute a smooth curve between them. |
Loop modes
Mode |
Description |
viz.OFF |
No looping. When the path reaches the end it will stop. |
viz.LOOP |
Standard looping. When the path reaches the end it will go back to the beginning. |
viz.SWING |
Swing loop. When the path reaches the end it will change direction and go back the other way. |
viz.CIRCULAR |
Circular loop. When the path reaches the end it will continue on to the first control point. In this case the control time for the first control point will be used to calculate the time between the control points. |