6.3.2 Tracking Guns
In this example, we will show you how to use "Links" to use same
objects to define motions for different methods. Any parameter object
of a method can be replaced by a link object which points to the actual
parameter. The parameter can be everywhere in the object hierarchy and
more than one link can point to it.
Lets consider the following situation: a sphere follows a path and no
matter where it goes, gun always points towards it. To do this:
1. Create a sphere and define a path for it using Animate/Create/Path.
2. Create a level object and name it as "Gun", at the same level with the
moving sphere object. Make it the current level.
3. Create a gun object under the level, pointing to the sphere.
4. Select Create/Structure/Method and create a SWEEP method. Create it at
the same level where the gun shape is; the purpose is to animate the
gun. Make the method level the current level.
5. Define a center of rotation for the gun by creating an offset primitive
under the method level; this is the first sweep parameter.
6. Select the B-Spline curve used for defining a motion for the sphere and
select the function Create/Structure/Link. Select the "link" and
Modify/Structure/Cut it. Then make the gun sweep method the current
level and Modify/Structure/Paste the link under the method. The link
will act as the second sweep parameter.
Play the animation, and your gun is rotated so it always points to the sphere.
Create another gun by duplicating the original gun (the whole sweeping
gun), move it to another place and rotate it so it still points to the
sphere, and when you play the animation, both guns follow the sphere.
|