9
322 Chapter 12: Animation
8.
Play the animation. The sphere moves in a
circle about the world origin (0,0,0). The radius
of the circular path is 100 units.
Ex ample continued : To change the r ad ius of the
cir cle:
The two 100s in the position expression from the
previous procedure specify the radius. To adjust
the radius of the circle’s path, create a symbolic
variable to represent the radius. The var iable has a
constan t value that is easy to edit.
1. Reopen Track View and the Expression
Controller dialog if necessary.
2. In the Name field of the Expression Controller
dialog, type radius Make sure Scalar is chosen,
and then click Create.
The variable name "r adius" appears in the
Scalars list of the dialog.
3. Click Assign To Constant.
A dialog titled "radius" opens.
4. Enter 150 in the Value field, and then click OK.
The radius variable is now 150.
Nextyou’llusethenewvariableinthe
expression.
Example continued: To replace the literal value with
thevariablename:
1.
In the Expression field, change 100 to radius in
both places. The expression should now look
like this:
[ radius*cos(360*NT), radius*sin(360*NT), 0]
2. Click Evaluate.
3. Play the animation. The sphere moves in a
circle about the world origin (0,0,0). The radius
of the circular path is 150 units.
Ex ample continued: To make the sphere rota te
about a box:
1.
Create a box about 40 units s quare, and animate
its position over three or four keyframes.
2. Select the sphere.
3. IntheNamefieldoftheExpressionController
dialog, enter boxposn. Choose Vec tor, and
then click Create.
Thename"boxposn"isdisplayedintheVectors
list in the lower-left area of the dialog.
Variable names are case sensitive; the variable
name should be lower case.
4. Click Assign to Controller.
The Tr ack View Pick dialog is displayed. It
shows the object hierarchy as it appears in the
left side of Track View-Dope Sheet.
5. In the Hierarchy list, highlight the Position
controller for Box01 and then click OK.
6. In the Expression field, add b oxposn as an
offset:
[radius * cos(360*NT), radius * sin(360*NT ),
0]+boxposn.
7. Click Evaluate, and then click Close.
Playtheanimationagain.Thespheremoves
in a c ircle around the box and follows the box
wherever it moves.
Interfa ce