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 three interpolation modes are linear, bezier, and cubic bezier. Linear interpolation is, as it sounds, a direct and uniform interpolation between the control points. The bezier mode uses the first and last control points as anchors and constructs a smooth path that, although defined by the control points, will not necessarily go through all of them. 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 travelling along the path will stay pointed down the path's trajectory. Note: applying automatic rotations will override whatever rotations are specified at individual control points.
Interpolation modes
|
Argument |
Description |
|
viz.LINEAR |
Interpolate linearly between control points. |
|
viz.BEZIER |
Use bezier interpolation between control points. Note: Bezier interpolation guarantees that the path will go through the first and last control point, but not the control points in between. Control times are ignored with bezier interpolation. They are only used to order the control points. To give a control point more weight, add it multiple times to the path. |
|
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.BEZIER |
Use bezier interpolation for this 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. |