Vizard 7 » Reference » Animation » Paths » Animation path basics
7.5

Animation path basics

One handy way to animate objects is with animation paths. An animation path is made up of a series of points in time where a change in the position, size, or orientation occurs. Animation paths interpolate between these "control points" so that you get a smooth transition between them. Each control point has a time stamp which specifies it's order along the path.

 

You can use the same animation path to animate any number of objects by linking those objects to the path. Animation points can be played once, they can be looped, and they can be set to swing back and forth along their timeline. The nature of the interpolation between control points can either be set over the entire animation path or at individual control points.

 

You can also link viewpoints to animation paths, although there are other commands specific to viewpoint movement.

 

To create an animation path, use the steps outlined in the example code below or see the full sample script at \examples\animationPaths\animatepath.py:

#Add the path.
path = viz.addAnimationPath()

#Add control points to the path, along with their time stamp.
path.addControlPoint(0,pos=(2,1,5),euler=(90,0,0),scale=(2,2,2))
path.addControlPoint(3,pos=(-2,1,6),euler=(0,90,0),scale=(.5,.5,.5))

#Loop the path in a swinging fashion (point A to point B to point A, etc.).
path.setLoopMode(viz.SWING)

#Add a model.
ball = viz.addChild('beachball.osgb')

#Link the model to a path.
link = viz.link(path,ball)

#Play the path.
path.play()

See also

In this section:

Animation path modes

Animation path events

Animation path command table

Other sections:

Action basics

Linking basics

Physics basics

Viewpoint basics

Example scripts:

Animation paths