Animation on a Path
"Path Animation" is a method of defining motion by defining a path that objects move along. This is a common feature in many animation packages, from Director to Maya. The path is defined by a list of points, and the object moves from one point to the next along the path.In YG, there are two nodes that will animate along a path: the pointMover and pointFollower. Both nodes use a text file with a list of points to define the path; the pointMover also includes orientations in its data file, so you specify how the object should rotate as it moves along the path. the pointFollower makes the object orient itself along the path automatically as it moves.
Example using a pointFollower:
| scenes/pointFollower.scene | data/square.path |
#include "User0" light () pointFollower car_animate (("square.path")) { object (("esprit.pfb")) } timer ((10), (0), (1), , when(changed,car_animate.($value))) |
0 0 0 0 10 0 10 10 0 10 0 0 0 0 0 |

note that the car doesn't seem to be driving forwards. This is because the car is modeled facing along the positive X-axis, but the pointFollower thinks that "forwards" is the positive Y-axis. so, the car actually moves sideways.
To prevent this, make your model facing forwards along the positive Y-axis; or, you can rotate it in the object
node.
The follower node is also a kind of interpolator. Its input is a value from 0.0 to 1.0, representing 0% to 100% of the way along the path. It doesn't animate automatically - to make it change its value, send messages from a timer node while the timer is running. The value of the timer goes from 0.0 to 1.0 over its duration, so sending that value to the pointFollower will make it move along its path.
The pointFollower is also a grouping transform node (it's based on the simpleTransform node). As it moves along the path, it moves any child nodes grouped with it. Since the pointFollower itself is invisible, you would usually want to put an object or a group of objects as its children.
However, you can also put any other nodes as children of the pointFollower. For instance, to make headlights for the car, you could add a spotlight node as a child of the pointFollower, positioned a little bit off the ground and pointing forwards and down.
#include "User0" object ((checkerfloor.b3d),(0 10 0),(2)) pointFollower car_animate (("square2.path")) { object (("esprit.pfb"),(0 0 90)) spotlight ((0 5 .15),(-5 0 0)) } timer ((10),(0),(1),, when(changed,car_animate.($value)), when(,))
(c) Ben Chang