This site hosted by Free.ProHosting.com
Google
main page
News Import/Export Rendering Links
Taelon's gmax Tutorials

Tutorial 6


Animation & Projected Shadows, Part Two

Tutorial 6 part 2

 

Other On Site Tutorials

Animation & Projected Shadows, Part Two

In this tutorial we will use an array to create a spiral staircase, then create a shape and use a path constraint to animate the bouncing ball that was created in Part One so that it bounces down the stairs.

 

Step 1) Create a stair step

Start gmax or select "File" > "Reset" to start a new scene.

(Note: If you are continuing from Part One, Do NOT Save the Scene.)

We will be using the "ball_bounce01" scene saved in Step 14 of Part One later on.

  1. In the Create tab of the Command Panel,
  2. Select the "Geometry" button, make sure "Standard Primitives" is selected from the drop-down list.
  3. Select Object type "Tube".
  4. Open the Keyboard Entry rollout.
  5. Set Inner Radius = 0.5
    Outer Radius = 3.0
    Height = 0.5

    In the Parameters Rollout,
  6. Set Height Segments = 1
    Cap Segments = 1
    Sides = 3
  7. Turn Slice On
    Slice From = 22.5
    Slice To = 0
  8. Turn on Generate Map Coords.
  9. Press the Create button
  10. Rt. click in the active viewport to get out of create mode
  11. Change the name to "Step01"
  12. If you want to Adjust the color of the step object, Click on the color swatch then in the "Object Color" window, select one of the basic colors or double click the "Current Color" swatch to customize it.

The tube section should resemble a slice of pie.
Step 1 step01

Step 1 tube
(Note: Creating New Materials and Assigning Maps was illustrated in detail in Tutorials 1 and 4.)

Step 2) Create the Step Material

Step01 should be selected.
  1. Open the Material Editor
  2. Create a New "Standard" Material
  3. Press the button next to the Diffuse color swatch

    The Material Navigator window opens
  4. Double click on "Bitmap".

    In the "Select Bitmap Image File" window,
  5. Navigate to the \GMAX\Tutorials\Materials\ folder
  6. Select the "drab_concrete.jpg"
  7. Press the "Open" button

    In the Material Navigator window,
  8. Press the "Show Map in Viewport" button.
  9. Press the "Apply" button.
  10. Close the Material Navigator window.
The step should be mapped in the viewport, but because of the default mapping of the tube object, each face is mapped individually.

This mapping looks pretty ugly, especially on the rising edge of the step.
Step 2 Map


Step 3) Remap the Step
  1. Select the Modify tab in the Command Panel.
  2. Scroll down the Modifier List
  3. Select the UVW Map modifier.
  4. Change the UVW Mapping Parameter to "Box" Mapping
  5. Press the "Fit" button if necessary.
  6. Set U Tile = 0.98
    This reduces the large shadow at the outer edge of the rising edge of the step, but will leave a shadow where the top and front faces meet.
Step 3 UVW Map
Step 4) Create an Array

We could copy the object a number or times and move it into position, but it's much easier to use the "Array" tool.
    The Step01 object should be selected
  1. Press the Array button on the Main Menu.
    The Array window opens
Step 4 array
Step 4 array set
Step 4) Create an Array (cont.)

Here we can specify the number of total elements we want in our array, as well as the incremental or total transformation of position, rotation and scale for each axis individually.
  1. Under "Type of Object", set Instance
Instance is a special type of "Copy", later if we decide to make modifications to all the objects in the array we only need to modify one and the changes will be inherited by all the copies.
  1. Under "Array Dimensions", 1D, Set Count=16, you should see the Total in Array = 16
We can set either the incremental amount to offset each element or we can specify the total, and the increment will be automatically calculated for us.
  1. Under Array Transformation, Incremental
    In the Move row, set Z = 0.5,
    under Totals you will see Z = 8.0 units
  2. In the Rotate row, press the arrow button on the "Totals" side of "Rotate"
  3. Set Z = 360.0 degrees
    You'll see the Incremental amount is calculated as 22.5
  4. Re-Orient should be selected.
  5. Press OK to build the array.
The array should be built containing 16 total objects, this will be our spiral staircase.

Step 5) Modify the Array

Since we don't have a central column for the staircase, there should be some overlap between the "steps".
    The last step of the array (step16) should still be selected
  1. Select the Tube object in the Modifier Stack
  2. Increase the "Slice From" parameter to 27.5
  3. Select the UVW Mapping modifier in the Stack
  4. Press the Alignment: "Fit" button
Notice that because we used "Instance" mode when creating our Array, the modifications to the base object and the UVW Map modifier affect all the steps in the array.

Step 4 Modify

Step 6) Create a Helix Shape
  1. In the Create tab of the Command Panel,
  2. Select the "Shapes" button, make sure "Splines" is selected from the drop-down list.
  3. Select Object type "Helix".
  4. Open the Keyboard Entry rollout.
  5. Set Z = 0.02
    Radius1 = 2.5
    Radius2 = 2.5
    Height = 8.0

    In the Parameters Rollout,
  6. Select CCW
  7. Press the Create button
  8. Rt. click in the active viewport to get out of create mode
The Helix should look centered in the Top viewport, but needs to be rotated to synchronize the start and end points to the staircase.

Step 7) Rotate the Helix
  1. Press "Select and Rotate" button
  2. In the Z Coordinate window enter 79.0
    This will align the Helix to the stairs
  3. Save the Scene as "Stairs"
Step 6 Helix

Step 7 Rotate

Step 7 Rotate Z
Step 8) Merge the Scenes
  1. In the Main Menu under File > Open the "ball_bounce01" scene that was saved in Part One, Step 14.
  2. Then in the Main Menu under File > Merge the "Stairs" scene,
  3. In the Merge window that opens press the "ALL" button to select all the objects in the scene,
  4. Press OK.

    A Duplicate Material Name Window pops-up,
  5. Select "Auto-Rename Merged Material"
Step 8 Merge
Step 9) Add a Path Constraint

  1. Select the Dummy01 object
  2. In the Main Menu under Animation > Constraints
    Select "Path Constraint"

    Step 9 Constraint

    (You'll see a dotted line that follows your cursor in the viewport)
  3. Hover the cursor over the Helix01 object,
  4. When the label appears, Click on the Helix in the viewport
  5. The Dummy (with the ball and plane of course) should snap to the end of the Helix
You will notice the Command Panel switches to the "Motion" tab for Dummy01.

In the Position List rollout you'll see a Path Constraint has been added.

In the "Path Parameters" rollout, Helix01 will be listed as the Target with Weight = 50

Also note that 2 new keys have been automatically created, one at each end of the timeline.

If you press play, you'll see an odd animation of the ball bounding up the stairs. This isn't what we want so we need to make some adjustments.

Step 10) Time Configuration

    Although 159 frames gave us a seamless animation in the "ball_bounce01" scene, we need to change it to 160 frames here.
  1. Press the "Time Configuration" button (or Rt. click on the play button)
  2. Change the Animation End Time to 160
  3. DO NOT press the Re-scale time button
  4. Press OK
Step 11) Adjust the Keys

    The Dummy01 object should still be selected
  1. Grab the key at frame 159 and drag it to position 0.

  2. Turn the Animate button ON
  3. Move the slider to the end of the timeline (frame 160)
  4. In the Path Parameter rollout of the Motion panel set Path Options > % Along Path = 0
  5. Turn the Animate button OFF and play the animation.
And there you have it, a ball bouncing down the stairs and only 8 key frames were used.

It's not exactly "Toy Story" but it should give you the basic building blocks for creating your own animated scenes.
Step 9 Path Constr Step 10 Time Config
Step 12) Modify the Animation

We can make the animation look a lot better with just a few changes.

    The ball bounces a bit too high,
  1. Turn the Animate button ON
  2. Select the ball, notice the key frames are at 0, 10 and 20
  3. Move the time slider to frame 10 and move the ball down from 13.02 to 10.02
  4. Turn the Animate button OFF and play the animation.
  5. Save the Scene as "Spiral_Stairs"
Step 13) Add Rotation to the Ball

That's better, but how about adding some rotation to the ball?

Because of the rotational component of the stairs if we add a simple rotation to the ball it will look correct only at the top and bottom.
    Make sure you have saved the scene before we demonstrate this.
  1. Select the Ball
  2. Turn the Animate button ON
  3. Advance the Time Slider to Frame 10
  4. Enter "Select and Rotate" mode
  5. Select "Local" Reference Coordinate System
  6. Hover your mouse over the Green Gizmo (Y Axis)
  7. When the Green Arrow lights up, move the mouse downward and watch the Y Axis coordinate display, stop when it reaches 180.
  8. Move the time slider to Frame 20, again rotate the Y axis 180 degrees.
  9. Rt. click over the Ball and select "Track View Selected"
  10. Expand the Tracks for the Ball
  11. Select Rotation in the Transforms sub-tree in the track view window
  12. Press the "Parameter Curve out of range Types" button, select Loop, press OK
  13. Close the Track View window.
  14. Turn the Animate button OFF and play the animation.
Notice that the rotation only looks correct near the top and bottom of the staircase, the rest of the time it looks wrong and even rotates backwards in the middle section.

Step 13-1) Correct Ball Rotation

Load the "Spiral_Stairs" scene you saved in Step 12. Play the animation to verify there is no rotation of the ball.
  1. Select the "Dummy01" object
  2. Select the Motion tab of the Command Panel, scroll down to the "Path Parameters" rollout
  3. Select "Follow". Notice how the Dummy and objects linked to it now orient themselves to follow the path of the Helix.
  4. Enter "Select and Rotate" mode
  5. Select the Ball
  6. Select "Local" Reference Coordinate System
  7. Turn the Animate button ON
  8. Advance the Time Slider to Frame 10
  9. Hover your mouse over the Green Gizmo (Y Axis)
  10. This time move the mouse Upwards until the Y Axis coordinate display reads Y -180
  11. Move the time slider to Frame 20, again rotate the Y axis -180 degrees.
  12. Rt. click over the Ball and select "Track View Selected"
  13. Expand the Tracks for the Ball
  14. Select Rotation in the Transforms sub-tree in the track view window
  15. Press the "Parameter Curve out of range Types" button, select Loop, press OK
  16. Close the Track View window
  17. Turn the Animate button OFF and play the animation.
    Now the rotation of the ball should match our expectations as it follows the path down the stairs.
If you notice a small hesitation at the top of the bounce, or the rotation doesn't look evenly distributed between the upward and downward motion of the ball, it's easy to correct.
  • Rt. click over the Ball and select "Track View Selected"
  • Select Rotation in the Transforms sub-tree.
  • Select the "Edit Keys" button
  • The Black Dots represent the Keys, similar to the lines in the Track Bar.
  • Select the Rotation Key at Frame 10 (it turns White when selected).
  • Press the Delete key on your keyboard.
    This deletes the intermediate key that we needed to be able to create a full rotation of the ball, without the key frame, the animation controller will smoothly interpolate the rotation between frame 0 and frame 20.
  • Close the Track View window and play the animation.
    The ball should smoothly rotate as it bounces down the stairs.
Step 14) Adjust the Shadow

Because we are using the Follow function of the Path Constraint, the shadow map on "Plane01" is tilted (aligned) to follow the path of the Helix. There are a number of ways to fix it, but the easiest is probably to just rotate it so that it's once again level with the top of the steps.

  1. Select the Plane01 Object
  2. Move the time slider to frame 0
  3. Turn the Animate button OFF
  4. Zoom your view in both the front and a side viewports so that the plane01 object nearly fills the windows.
  5. Enter "Select and Rotate" mode
  6. Select "Local" Reference Coordinate System
  7. Hover your mouse over the Green Gizmo (Y Axis)
  8. Rotate the plane until it looks like a flat line in the side and front viewports

  9. Save the Scene as "Spiral_Stairs"
Step 15) Add keys to the Shadow

Because the path goes through the steps, the shadow disappears at times. We can fix this by cheating a little and adding a few key frames.

  1. Select the Plane01 Object
  2. Turn the Animate button ON
  3. Zoom in your view in the front and a side viewport
  4. Enter "Select and Move" mode
  5. Select "View" or "World" Reference Coordinate System
  6. Move the Time Slider to Frame 5
  7. Move the plane UP in the Z Axis until the Coordinate window position = 8.02
  8. Move the Time Slider to Frame 10
  9. Move the plane in Z Axis until the Coordinate window position = 7.55
  10. Move the Time Slider to Frame 15
  11. Move the plane UP in the Z Axis until the Coordinate window position = 7.52
  12. Scrub the Time Slider from Frames 0 to 20
    The shadow should stay above the steps now.
  13. Rt. click the above the Plane01 object and select "Track View Selected"
  14. Expand the Plane01 and Transform Tracks
  15. Press the "Parameter Curve out of range Types" button,
  16. Select Loop, press OK
  17. Play the animation.
  18. Save the Scene
Even though we cheated a little with the position of the fake shadow map, from most vantage points it should look convincing as it follows the bouncing ball down the staircase.

I hope this tutorial gave you a good understanding of some of the basic animation techniques, and gave you some ideas for creating fake shadows and using them to bring your own creations to life.



 

I hope you enjoyed this tutorial.
If you find any errors or have difficulty following this tutorial,
please post in the forum or contact me at the Email address below. Thanks!


top of page



 

Tutorial created on 14-Aug-2003
All content is Copyright © Taelon 2003, unless otherwise noted.
Page updated on 18-Aug-2003