Adding and Adjusting Flight Paths
Flying a Spacefighter
Taking Control of Mars, Its Moons, and the Space Station
Animating the Spacefighter with Constraints and Controllers
In
this lesson, you'll use an assortment of constraints and controllers
with a flight of spacefighter on a mission.
Set
up the lesson:
Using a Dummy Object to Control the Flight
Dummy objects are helper objects. You can create
them from the Helpers button on the Create panel. They can be useful
when setting up an animation. By animating a dummy, you can focus
on getting your motion set up using a very simple object that doesn't
slow down your system. Once the dummy animation is complete you
link objects to the dummy. Now wherever the dummy moves, the object
goes with it.
Link
the spacefighters to the dummy:
-
Activate
the Top viewport, if it's not already active, and click the Select
And Link button from the Main toolbar.
- Select FlightLeader and
drag the cursor over the dummy, SpaceshipControl. Release
the mouse button.
FlightLeader is now linked to
the SpaceshipControl. Wherever you
move SpaceshipControl, FlightLeader will
follow.
- Link
both Wingman01 and Wingman02 to SpaceshipControl.
Add
a path constraint to the dummy:
-
In the
Top viewport, use Zoom Extents to view the scene.
-
Click Select Object to turn
it on and turn off Select And Link.
- Select SpaceshipControl.
- From
the Animation menu, choose Constraints > Path Constraint. Drag the
cursor and click the flightpath.
SpaceshipControl jumps
to the beginning of the path. The spacefighters follow along since
they're linked to the dummy.
- In
the Path Parameters rollout, make the following settings.
- Turn
on Follow, Bank, and Constant Velocity.
- In
the Axis group, turn on Y and Flip.
- Set
the Bank Amount to 7.0 and the Smoothness to 1.0.
- Activate
the SpaceCam viewport and play the animation.
All three
spacefighters move along the flightpath.
- Save
the scene as MyFlight01.max.
Making the Camera Follow the Action
In this exercise, you'll use the Link Constraint
to make the camera follow the flight as it passes by. Continue from
the last lesson or load flyingspacefighter04.max
Add
link constraint to the camera:
-
Open
the Display panel and turn off Cameras in the Hide By Category rollout.
The camera, SpaceCam,
will appear.
-
In the
Top viewport, use Zoom Extents to view the scene. Select the camera
target.
Also make sure the time slider is set to frame
0 (zero).
- From
the Main menu, choose Animation > Constraints > Link Constraint. Click
the flightpath to set the first Link
Parameter at frame 0 (zero).
NoteFor
this step and the one that follows, Auto Key doesn’t need to be turned
on, because the Link constraint is active.
- Move
the time slider to frame 80 and click the Add Link button in the
Link Params rollout. Click SpaceshipControl.
- Click
Add Link to turn it off.
- Activate
the SpaceCam viewport and play the animation.
The camera
target is linked to the flightpath from frames 0 to 79.
At frame 80, the camera target begins to specifically track the
SpaceshipControl object.
- Save
the scene as MyFlight02.max.
Your Flight Leader Gets Cocky
Your flight leader has a pretty bold character.
He or she feels a victory roll is in order as the flight passes
by your vantage point from SpaceCam. In this exercise, you'll
use the Orientation Constraint to control the rotation of the flight
leader's spacefighter as it performs a barrel roll. Continue from
the last lesson or load flyingspacefighter05.max.
-
In the
Top viewport, use Region Zoom to view the three spacefighters.
-
On the
Create panel, click Helpers, then Dummy. Create a new dummy object
near the FlightLeader and name it barrelroll.
-
Click
Select And Link and link barrelroll to SpaceshipControl.
- From
the Tools menu, choose Align, and click SpaceshipControl.
The Align
Selection (SpaceshipControl) dialog appears.
- In
the Align Position (Screen) group, turn off the X, Y, and Z Positions.
- In
the Align Orientation (Local) group, turn on the X, Y, and Z Axis
controls and click OK.
The barrelroll dummy
now has the same orientation as the SpaceshipControl.
-
On the
Motion panel, open the Assign Controller rollout, if it's not open,
and select the Rotation: Euler XYZ controller.
-
Click
the Assign Controller button and choose TCB Rotation from the Assign
Rotation Controller dialog.
NoteDon't
miss this step. It allows you to rotate the barrelroll dummy
about its local Y axis.
Animate
the victory roll:
- Select
the FlightLeader in the Top viewport.
- Open
the Animation menu and choose Constraints > Orientation Constraint.
Move the cursor over the barrelroll dummy and select it.
You'll
see barrelroll added to the Orientation
Constraint Target list on the Motion panel.
- Select barrelroll and
make sure the time slider is at frame 0 (zero).
-
Turn
on the Set Key toggle and click the Set Key button.
-
Move
the time slider to frame 110 and click Set Key again.
You've
added two keys that will keep the FlightLeader flying
normally from frames 0 to 110.
- Activate
the SpaceCam viewport and move the time slider to frame 130.
-
Click
Select And Rotate and change the Reference Coordinate System to
Local.
- Click
the barrelroll dummy and rotate it
around the Y-axis to about 180 degrees
and click the Set Key button.
NoteIf
you'd like to be precise, you can enter the rotation in the Y-axis
type-in field on the status bar.
- Move
the time slider to frame 150 and rotate the barrelroll dummy
around the Y-axis another 180 degrees
and click the Set Key button. Turn off the Set Key Toggle when you've
finished.
- Save
the scene as MyFlight03.max and play the animation.
A Wingman in Trouble
While the FlightLeader is
performing stunts, Wingman01 seems to be having some
trouble. He doesn't seem to be flying as smoothly as the others.
In this exercise, you'll use the Noise Controller to add some turbulence
to Wingman01 flight dynamics. Continue
from the last lesson or load flyingspacefighter06.max.
NoteIf you continue from the last lesson, make
sure the time slider is back on frame 0 (zero).
Add
turbulence:
-
In the
Top viewport, use Region Zoom to view the three spacefighters, if
you haven't done so already.
You might
have to do a Zoom Extents first, then a Region Zoom to see the three
fighters.
- Select Wingman01.
- On
the Animation menu, choose Position Controllers > Noise.
Doing this
automatically adds a List Controller to the Wingman01. The Position
List contains the original Linear Position and the new Noise Position
controller with default Weight settings of 100.0 percent.
- Play
the animation and note the erratic flying of Wingman01.
- Stop
the playback and change the Weight of the Noise Position controller to 25.0 percent.
Now the
flight path of the Wingman01 spacefighter is affected
by slight battle damage.
- Save
the scene as MyFlight04.max.
A Wingman Is Called Away
Now it looks like Wingman02 has
received a transmission and is being ordered to peel off and fly
somewhere else. You'll revisit the Link Constraint to make Wingman02 follow
the FlightLeader for a little while
then take off on another path. Continue from the last lesson, or
load flyingspacefighter07.max.
Alter
course for Wingman02:
- Reset
your time slider to frame 0 (zero) and zoom to the trio of spacefighters
in the Top viewport.
- Create
a new dummy near Wingman02 and call it WingmanControl.
- Right-click
any viewport and choose Unhide By Name from the quad menu. Select wingmanpath and
click Unhide.
A yellow path appears in front of Wingman02.
- Make
sure the new dummy, WingmanControl, is still selected
and choose Animation > Constraints > Path Constraint. Drag
the cursor over and pick wingmanpath.
The WingmanControl jumps
to the beginning of wingmanpath.
- In
the Path Parameters rollout duplicate the previous settings.
- Turn
on Follow, Bank, and Constant Velocity.
- In
the Axis group, turn on Y and Flip.
Make
Wingman02 change paths:
-
In the
Top viewport, select Wingman02 and click the Select
And Unlink button.
Wingman02 is no longer linked
to the SpaceshipControl dummy object.
- From
the Animation menu, choose Constraint > Link Constraint and select SpaceshipControl.
Wingman02 will
work as it did before, but the link constraint will give you the
flexibility to have it follow a different path.
- Move
the time slider to frame 45 and click the Add Link button in the
Link Params rollout on the Motion panel.
- Click
the WingmanControl dummy.
You will
see WingmanControl is added to the
Target list, and when Wingman02 gets to frame 45, the
spacefighter begins to follow the WingmanControl dummy
on the other path.
- Save
the scene as MyFlight05.max and play the animation.
Make
Wingman02 roll out of formation:
To make Wingman02 roll
out of formation, you'll use the Orientation Constraint again.
- Move
the time slider back to frame 0 (zero), if it's not there already.
- Create
another dummy object in the Top viewport near Wingman02 and name
it wingmanroll.
- Use
Select And Move to position wingmanroll next
to Wingman02.
Watch the
Front and Right viewports to help you position it. This will help you
keep the objects in your scene organized.
-
Click
Select And Link and link wingmanroll to WingmanControl.
- From
the Tools menu, choose Align, and click WingmanControl.
The Align
Selection (WingmanControl) dialog appears.
- In
the Align Position (Screen) group, make sure the X, Y, and Z Position controls
are turned off.
- In
the Align Orientation (Local) group, turn on the X, Y, and Z axis
controls and click OK.
The wingmanroll dummy
aligns to WingmanControl.
NoteThis is important because you want to make
sure that rotation values you give
wingmanroll
, later
on, will be based on the initial orientation of
WingmanControl
.
Otherwise, any rotation you give
wingmanroll
will result
in the spaceship tumbling out of control.
- On
the Motion panel, open the Assign Controller rollout, and select
the Rotation: Euler XYZ controller.
-
Click
the Assign Controller button and choose TCB Rotation from the Assign
Rotation Controller dialog.
NoteIf
you don't assign the TCB Rotation controller, you will not be able
to rotate
wingmanroll
about
a local axis.
- Select Wingman02 in
the Top viewport.
- Open
the Animation menu and choose Constraints > Orientation Constraint.
Move the cursor over wingmanroll and select it.
You'll
see wingmanroll added to the Orientation
Constraint target list in the Orientation Constraint rollout on
the Motion panel.
- Select wingmanroll in
the Top viewport.
-
Turn
on the Set Key toggle and click the Set Key button.
-
Move
the time slider to frame 60 and click Set Key again.
You've
added two keys that will keep Wingman02 flying
normally from frames 0 to 60.
- Activate
the SpaceCam viewport and move the time slider to frame 85.
-
Click
Select And Rotate and change the Reference Coordinate System to
Local.
- You'll
make two rotations during this step:
- Enter –15 in
the X-axis Coordinate Display Type-in field and click the Set Key
button.
- Enter 90 in
the Y-axis Coordinate Display Type-in field and click the Set Key
button.
- Move
the time slider to frame 100 to make the next two rotations:
- Rotate 5 degrees
around the Z-axis and click the Set Key button.
- Rotate 90 degrees
around the Y-axis and click the Set Key button again.
- Move
the time slider to frame 115 to make the next two rotations:
- Rotate 10 degrees
around the Z-axis and click the Set Key button.
- Rotate 90 degrees
around the Y-axis and click the Set Key button again.
- Turn
off the Set Key toggle when you've finished. Save the scene as MyFlight06.max and
play the animation.