Chapter 5

Animating a Bouncing Ball

The best way to learn how to animate is to jump right in and start animating. By doing so, you’ll take a good look at the 3ds Max® animation tools so you can start editing animation and developing your timing skills.

Topics in this chapter include the following:

  • Animating the ball
  • Refining the animation

A classic exercise for all animators is to create a bouncing ball. It is a straightforward exercise, but there is much you can do with a bouncing ball to show character. Animating a bouncing ball is a good exercise in physics as well as cartoon movement. You’ll first create a rubber ball, and then you’ll add cartoonish movement to accentuate some principles of the animation. Aspiring animators can use this exercise for years and always find something new to learn about bouncing a ball.

In preparation, download the Bouncing Ball project from the companion web page at www.sybex.com/go/3dsmax2013essentials to your hard drive. Set your current project by choosing Application ⇒ Manage ⇒ Set Project Folder and selecting the Bouncing Ball project that you downloaded.

Animating the Ball

Your first step is to keyframe the positions of the ball. As you learned in Chapter 1, “The 3ds Max Interface,” keyframing is the process—borrowed from traditional animation—of setting positions and values at particular frames of the animation. The computer interpolates between these keyframes to fill in the other frames to complete a smooth animation.

Open the Animation_Ball_00.max scene file from the Scenes folder of the Bouncing Ball project you downloaded. If you receive a warning to Disable Gamma/LUT, click OK.

Start with the gross animation, or the overall movements. This is also called blocking. First, move the ball up and down to begin its choreography.

Follow these steps to animate the ball:

1. Move the pivot point for the ball from the center of the ball to the bottom of the ball. Select the ball, and then go to the Hierarchy panel (i0501.tif). Choose Pivot, and under the Adjust Pivot rollout, click the Affect Pivot Only button. Zoom in on the ball in the Front viewport and move the pivot so that it is at the bottom of the ball. Then click the Affect Pivot Only button again to deactivate—but you already knew that.
2. Move the Time slider to frame 10. The Time slider is at the bottom of the screen below the viewports, as shown in Figure 5-1. The Time slider is used to change your position in time, counted in frames.

Figure 5-1: The Time slider allows you to change your position in time and scrub your animation.

c05f001.tif
Scrubbing the Time Slider
You can click and drag the horizontal Time slider bar to change the frame in your animation on the fly; this is called scrubbing. The bar displays the current frame/end frame. By default, your 3ds Max window may show a start frame of 0 and an end frame of 100.
3. Now, in the lower-right corner of the window, click the Auto Key button, as shown in Figure 5-2. Both the Auto Key button and the Time slider turn red. This means that any movement in the objects in your scene will be recorded as animation. How exciting!

Figure 5-2: The Auto Key button records your animations.

c05f002.tif
4. With the ball selected, move it along the Z-axis down to the ground plane, so it is 0 units in Z-axis when you release the mouse button in the Transform type-in box at the bottom of the interface. You can also just enter the value and press Enter.

This exercise has created two keyframes, one at frame 0 for the original position the ball was in, and one at frame 10 for the new position to which you just moved the ball.

Copying Keyframes

Now you want to move the ball up to the same position in the air as it was at frame 0. Instead of trying to estimate where that was, you can just copy the keyframe at frame 0 to frame 20.

You can see the keyframes you created in the timeline; they appear as red boxes. Red keys represent Position keyframes, green keys represent Rotation, and blue keys represent Scale. When a keyframe in the timeline is selected, it turns white. Now let’s copy a keyframe:

1. Select the keyframe at frame 0; it should turn white when it is selected. Hold down the Shift key on the keyboard (this is a shortcut for the Clone tool), and click and drag the selected keyframe to copy it to frame 20. This will create a keyframe with the same animation parameters as the keyframe at frame 0, as shown in Figure 5-3.

Figure 5-3: Press Shift and move the keyframe to copy it to frame 20.

c05f003.tif
2. Click and drag the Time slider to scrub through the keyframes. Turn off Auto Key.

Once you copy keyframes if for any reason you want to change their parameters, you can access keyframe values in the timeline. Just right-click directly on the keyframe and a popup menu will appear. Choose from the menu what track you want to modify; you will get a type-in dialog to edit keyframe value.

Using the Track View–Curve Editor

Right now the ball is going down and then back up. To continue the animation for the length of the timeline, you could continue to copy and paste keyframes as you did earlier—but that would be very time-consuming, and you still need to do your other homework and clean your room. A better way is to loop, or cycle, through the keyframes you already have. An animation cycle is a segment of animation that is repeatable in a loop. The end state of the animation matches up to the beginning state, so there is no hiccup at the loop point.

In 3ds Max terminology, cycling animation is known as parameter curve out-of-range types. This is a fancy way to create loops and cycles with your animations and specify how your object will behave outside the range of the keys you have created. This will bring us to the Track View, which is an animator’s best friend. You will learn the underlying concepts of the Curve Editor as well as its basic interface throughout this exercise.

The Track View is a function of two animation editors, the Curve Editor and the Dope Sheet. The Curve Editor allows you to work with animation depicted as curves on a graph that sets the value of a parameter against time. The Dope Sheet displays keyframes over time on a horizontal graph, without any curves. This graphical display simplifies the process of adjusting animation timing because you can see all the keys at once in a spreadsheet-like format. The Dope Sheet is similar to traditional animation exposure sheets, or X-sheets.

Navigation inside the Track View – Curve Editor is pretty much the same as navigating in a viewport; the same keyboard/mouse combinations work for panning and zooming.

You will use the Track View – Curve Editor (or just the Curve Editor for short) to loop your animation in the following steps:

1. With the ball selected, in the menu bar choose Graph Editors ⇒ Track View – Curve Editor. In Figure 5-4, the Curve Editor displays the animation curves of the ball so far.

Figure 5-4: The Curve Editor shows the animation curves of the ball.

c05f004.tif
2. A menu bar runs across the top of the Curve Editor. In the Controller menu, select the Out-of-Range Types option, as shown in Figure 5-5.

Figure 5-5: Selecting Out-of-Range Types

c05f005.tif
3. Doing so opens the Param Curve Out-of-Range Types dialog box, shown in Figure 5-6. Select Loop in this dialog box by clicking its thumbnail. The two little boxes beneath it will highlight. Click OK.
4. Once you set the curve to Loop, the Curve Editor displays your animation, as shown in Figure 5-7. The out-of-range animation is shown as a dashed line. Scrub your animation in a viewport and see how the ball bounces up and down throughout the timeline range.

Figure 5-6: Choosing to loop your animation

c05f006.tif

Figure 5-7: The Curve Editor now shows the looped animation curve.

c05f007.tif

Reading Animation Curves

As you can see, the Track View – Curve Editor (from here on called just the Curve Editor) gives you control over the animation in a graph setting. The Curve Editor’s graph is a representation of an object’s parameter, such as position (values shown vertically) over time (time shown horizontally). Curves allow you to visualize the interpolation of the motion. Once you are used to reading animation curves, you can judge an object’s direction, speed, acceleration, and timing at a mere glance.

Here is a quick primer on how to read a curve in the Curve Editor.

In Figure 5-8, an object’s Z Position parameter is being animated. At the beginning, the curve quickly begins to move positively (that is, to the right) on the Z-axis. The object shoots up and comes to an ease-in, where it decelerates to a stop, reaching its top height. The ease-in stop is signified by the curving beginning to flatten out at around frame 70.

In Figure 5-9, the object slowly accelerates in an ease-out in the positive Z direction until it hits frame 100, where it suddenly stops.

Figure 5-8: The object quickly accelerates to an ease-in stop.

c05f008.tif

Figure 5-9: The object eases out to acceleration and suddenly stops at its fastest velocity.

c05f009.tif

In Figure 5-10, the object eases in and travels to an ease-out where it decelerates, starting at around frame 69, to where it slowly stops, at frame 100.

Finally, in Figure 5-11, to showcase another tangent type, step interpolation makes the object jump from its Z Position in frame 20 to its new position in frame 21.

Figure 5-12 shows the Curve Editor, with its major aspects called out for your information.

Figure 5-10: Ease-out and ease-in

c05f010.tif

Figure 5-11: Step interpolation makes the object “jump” suddenly from one value to the next.

c05f011.tif

Figure 5-12: The Curve Editor

c05f012.eps

Refining the Animation

Let’s play the animation now. In the bottom right of the interface, you will see an animation player with the sideways triangle to signify Play. Select the Camera01 viewport and click the Play button. The framework of the movement is getting there. Notice how the speed of the ball is consistent. If this were a real ball, it would be dealing with gravity; the ball would speed up as it got closer to the ground and there would be “hang time” when the ball was in the air on its way up as gravity took over to pull it back down.

This means you have to edit the movement that happens between the keyframes. This is done by adjusting how the keyframes shape the curve itself, using tangents. When you select a keyframe, a handle will appear in the user interface (UI), as shown in Figure 5-13.

Figure 5-13: The keyframe’s handle

c05f013.tif

This handle adjusts the tangency of the keyframe to change the curvature of the animation curve, which in turn changes the animation. There are various types of tangents, depending on how you want to edit the motion. By default the Auto tangent is applied to all new keyframes. This is not what you want for the ball, although it is a perfect default tangent type to have.

Animation Controllers
Anything you animate is handled by a controller. Controllers store animation and they interpolate between values. The default controllers arePosition: Position XYZRotation: Euler XYZScale: Bézier Scale

Editing Animation Curves

Let’s edit some tangents to better suit your animation. The intent is to speed up the curve as it hits the floor and slow it down as it crests its apex. Instead of opening the Curve Editor through the menu bar, this time you are going to use the shortcut. Close the large Curve Editor dialog box, and then at the bottom-left corner of the interface, click the Open Mini Curve Editor button shown in Figure 5-14.

Figure 5-14: Click the Open Mini Curve Editor button.

c05f014.tif

The Mini Curve Editor is almost exactly the same as the one you launch through the main menu. A few tools are not included in the Mini Curve Editor toolbar, but you can find them in the menu bar of the Mini Curve Editor.

To edit the curves, follow these steps:

1. Scroll down the Controller window on the left of the Mini Curve Editor by dragging the Pan tool (the hand cursor) to find the Ball object’s position. Click on the Z Position track. This will bring only the curves that you want to edit to the Key Editing window.
2. The Z Position curve is blue, as is almost everything relating to the Z-axis. The little gray boxes on the curves are keyframes. Select the keyframe at frame 10. You may need to scrub the Time slider out of the way if you are on frame 10. The key will turn white when selected. Remember, if you need to zoom or pan in the Curve Editor’s Key Editing window, you can use the same shortcuts you would use to navigate in the viewports. You will change this key’s tangency to make the ball fall faster as it hits and bounces off the ground.
3. In the Mini Curve Editor toolbar, change the tangent type for the selected keyframe from the Auto default to Fast by clicking the Set Tangents To Fast icon (i0502.tif). When you do this, you will see the animation curve change shape, as shown in Figure 5-15.

Figure 5-15: The effect of the new tangent type

c05f015.tif
4. Select the Camera viewport and play the animation. You can easily correlate how the animation works with the curve’s shape as you see the Time slider travel through the Mini Curve Editor as the animation plays.

Finessing the Animation

Although the animation has improved, the ball has a distinct lack of weight. It still seems too simple and without any character. In situations such as this, animators can go wild and try several different things as they see fit. Here is where creativity helps hone your animation skills, whether you are new to animation or have been doing it for 50 years.

Animation shows change over time. Good animation conveys the intent, the motivation for that change between the frames.

Squash and Stretch

The concept of squash and stretch has been an animation staple for as long as there has been animation. It is a way to convey the weight of an object by deforming it to react (usually in an exaggerated way) to gravity, impact, and motion.

You can give your ball a lot of flair by adding squash and stretch to give the object some personality. Follow along with these steps:

1. Press the N key to activate Auto Key. In the Mini Curve Editor, drag the yellow double-line Time slider (called the track bar Time slider) to frame 10. Click and hold the Scale tool to access the flyout. Choose the Select And Squash tool (i0503.tif). Center the Scale cursor over the Z-axis of the Scale Transform gizmo in the Camera viewport. Click and drag down to squash down about 20 percent. Doing so will scale down on the Z-axis and scale up on the X- and Y-axes to compensate, as shown in Figure 5-16.

Figure 5-16: Use the Select And Squash tool to squash down the ball on impact.

c05f016.tif
2. Move to frame 0. Click and drag up to stretch the ball up about 20 percent (so that the ball’s scale in Z is about 120). When you scrub through the animation, you will see that the ball stretched at frame 0; then the ball squashes and stays squashed for the rest of the time. You’ll fix that in the next step.
You need to copy the Scale key from frame 0 to frame 20 first, and then apply a loop for the Parameter Curve Out-of-Range Type. Because the Mini Curve Editor is open, it obstructs the timeline; therefore, you should copy the keys in the Mini Curve Editor. You can just as easily do so in the regular Curve Editor in the same way.
3. In the Mini Curve Editor, scroll in the Controller window until you find the Scale track for the ball. Highlight it to see the keyframes and animation curves. Click and hold the Move Keys tool in the Mini Curve Editor toolbar to roll out and access the Move Keys Horizontal tool (i0504.tif)
4. Click and drag a selection marquee around the two keyframes at frame 0 in the Scale track to select them. Hold the Shift key and then click and drag the keyframes at frame 0 to frame 20.
5. In the Mini Curve Editor’s menu bar, select Controller ⇒ Out-of-Range Types. Choose Loop, and then click OK. Play the animation. The curves are shown in Figure 5-17.

Figure 5-17: The final curves

c05f017.tif

Setting the Timing

Well, you squashed and stretched the ball, but it still doesn’t look right. That is because the ball should not squash before it hits the ground. It needs to return to 100 percent scale and stay there for a few frames. Immediately before the ball hits the ground, it can squash into the ground plane to heighten the sense of impact. The following steps are easier to perform in the regular Curve Editor rather than in the Mini Curve Editor. So close the Mini Curve Editor by clicking the Close button on the left side of its toolbar.

Open the Curve Editor to fix the timing, and follow these steps as if they were law:

1. Move the Time slider to frame 8; Auto Key should still be active. In the Curve Editor, in the Controller window select the ball’s Scale track so that only the scale curves appear in the Editing window. In the Curve Editor’s toolbar, click the Insert Keys icon (i0505.tif). Your cursor will change to an arrow with a white circle at its lower right. Click on one of the Scale curves to add a keyframe on all the Scale curves at frame 8. Because scales X and Y are the same value, you will see only two curves instead of three.
2. Because they are selected, the keys will be white. In the Key Entry tools, you will find two text type-in boxes. The box on the left is the frame number, and the box on the right is the selected key’s (or keys’) value. Because more than one key with a different value is selected, there is no number in that type-in box. Enter 100 (for 100 percent scale) in the right type-in box, and a value of 100 for the scale in X, Y, and Z for the ball at frame 8, as shown in Figure 5-18.

Figure 5-18: Enter a value of 100.

c05f018.tif
3. Move the Time slider to frame 12, and do the same thing in the Curve Editor. These settings are bracketing the squash so that the squash happens only a couple frames before and a couple frames after the ball hits the ground. Press the N key to deactivate Auto Key. Save your work.

Once you play back the animation, the ball will begin to look a lot more like a nice cartoonish one, with a little character. Experiment by changing some of the scale amounts to have the ball squash a little more or less, or stretch it more or less to see how that affects the animation. See if it adds a different personality to the ball. If you can master a bouncing ball and evoke all sorts of emotions from your audience, you will be a great animator indeed.

Moving the Ball Forward

You can load the Animation_Ball_01.max scene file from the Bouncing Ball project on your hard drive (or from the companion web page) to catch up to this point or to check your work.

Now that you have worked out the bounce, it’s time to add movement to the ball so that it moves across the screen as it bounces. Layering animation in this fashion, where you settle on one movement before moving on to another, is common. That’s not to say you won’t need to go back and forth and make adjustments through the whole process, but it’s generally nicer to work out one layer of the animation before adding another. The following steps will show you how:

1. Move the Time slider to frame 0. Select the ball with the Select And Move tool, and move the ball in the Camera viewport to the left so it is still within the camera’s view. That’s about –30 units on the X-axis.
2. Move the Time slider to frame 100. Press the N key to activate Auto Key again. Move the ball to the right about 60 units so that the ball’s X Position value is about 30.
3. Don’t play the animation yet; it isn’t going to look right. Go to the Curve Editor, scroll down in the Controller window, and select the X Position track for the ball, as shown in Figure 5-19.

Figure 5-19: The X Position of the ball does not look right.

c05f019.tif
When you created the keyframes for the up and down movement of the ball (which was along the Z-axis), the 3ds Max software automatically created keyframes for the X and Y Position tracks, both with essentially no value. To fix it, keep following these steps.
4. Select the keyframes on the X Position track at frame 10 and frame 20, and delete them by pressing the Delete key on your keyboard.
5. Click the Parameter Curves Out-of-Range Types button, and select Constant. This removes the loop from the X Position track but won’t affect the Z Position track for the ball’s bounce. Press the N key to deactivate Auto Key. Play the animation. You can use the / (slash) button as a shortcut to play the animation.
6. There is still a little problem. Watch the horizontal movement. The ball is slow at the beginning, speeds up in the middle, and then slows again at the end. It eases out and eases in. This is caused by the default tangent, which automatically adds a slowdown as the object goes in and out of the keyframe. In the Curve Editor, select both keys for the X Position curve and click the Set Tangents To Linear icon (i0506.tif) to create a straight line of movement so there is no speed change in the ball’s movement left to right.

Figure 5-20 shows the proper curve.

Figure 5-20: The X Position curve for the ball’s movement now has no ease-out or ease-in.

c05f020.tif

Adding a Roll

You need to add some rotation, but there are several problems with this. One, you moved the pivot point to the bottom of the ball in the very first step of the exercise. You did that so the squashing would work correctly—that is, it would be at the point of contact with the ground. If you were to rotate the ball with the pivot at the bottom, it would look like Figure 5-21.

Figure 5-21: The ball will not rotate properly because the pivot is at the bottom.

c05f021.eps

Using the XForm Modifier

You need a pivot point at the center of the ball, but you can’t just move the existing pivot from the bottom to the middle—it would throw off all the squash and stretch animation. Unfortunately, an object can have only one pivot point. To solve the issue, you are going to use a modifier called XForm. This modifier has many uses. You’re going to use it to add another pivot to the ball in the following steps:

1. Select the ball. From the menu bar, select Modifiers ⇒ Parametric Deformers ⇒ XForm. You may also select this option from the modifier list in the Modify tab. XForm will be added to the ball in the modifier stack, and an orange bounding box will appear over the ball in the viewport. XForm has no parameters, but it does have sub-objects.
2. Expand the modifier stack by clicking the black box with the plus sign next to XForm. Then click Center. In the next step, you will use the Align tool to center the XForm’s center point on the ball.
3. Click the Align tool, and then click on the ball. In the resulting dialog box, make sure the check boxes for X, Y, and Z Position are checked, which means those axes are active. Now click Center under Target Object, and then click OK. The XForm’s center will move.

Now to be clear, this isn’t a pivot point. This is the center point on the XForm modifier. If you go to the modifier stack and click on the sphere, the pivot point will still be at the bottom.

The XForm modifier allows the ball to rotate without its squashing and stretching getting in the way of the rotation. By separating the rotation animation for the ball’s roll into the modifier, the animation on the Sphere object is preserved.

Animating the XForm Modifier

To add the ball’s roll to the XForm modifier, follow along with these steps:

1. Turn on Auto Key and choose the Select And Rotate tool.
2. In the modifier stack, click on Gizmo for the sub-object of XForm. This is a very important step because it tells the modifier to use the XForm’s center instead of using the pivot point of the ball.
3. In the Camera viewport, move the Time slider to frame 100 and rotate the ball 360 degrees on the Y-axis (you can use Angle Snap Toggle to make it easier to rotate exactly 360 degrees). Click on the XForm modifier to deactivate the sub-object mode. Play the animation.
The Ball Doesn’t Rotate 360 Degrees!
If you rotate the ball in the third step 360 degrees but the ball does not animate, the 3ds Max software could potentially be interpreting 360 degrees to be 0 degrees in the Curve Editor, thereby creating a flat curve. If this is the case, you can try rotating the ball 359 degrees instead to force the animation to work. You could also manually change the value in the Curve Editor for the keyframe at frame 100 to a value of 360.

The ball should be a rubbery cartoon ball at this point in the animation. Just for practice, let’s say you need to go back and edit the keyframes because you rotated in the wrong direction and the ball’s rotation is going backward. Fixing this issue requires you to go back into the Curve Editor as follows.

1. Open the Curve Editor (mini or regular) and scroll down in the Controller window until you see the Ball tracks. Below the Ball’s Transform track is a new track called Ball/Modified Object.
2. Expand the track by clicking on the plus sign in the circle next to the name. Go to the Gizmo track and select the Y Rotation track. You will see the Function curve in the Key Editing window.
3. You want the keyframe at frame 0 to have the value 0 and the keyframe at frame 100 to be a value of 360. Select both keyframes and change the tangents to Linear, as shown in Figure 5-22.

Figure 5-22: The XForm’s gizmo selected in the Controller window with the rotation of the ball set to Linear Tangents

c05f022.tif

Close the Curve Editor and play the animation. Play the bounce ball.avi movie file located in the RenderOutput folder of the Bouncing Ball project to see a render of the animation. You can also load the Animation_Ball_02.max scene file from the Bouncing Ball project to check your work.

The Essentials and Beyond
Working with the bouncing ball gave you quite a bit of experience with the 3ds Max animation toolset. There are several ways to animate a bouncing ball using the 3ds Max software. It is definitely a good idea to try this exercise a few times at first and then to come back to it later—after you have learned other 3ds Max techniques.
Animation can be a lot of fun, but it is also tedious and sometimes aggravating. A lot of time, patience, and practice are required to become good at animation. It all boils down to how the animation makes you think. Is there enough weight to the subjects in the animation? Do the movements make sense? How does nuance enhance the animation? These are all questions you will begin to discover for yourself. This chapter merely introduced you to how to make things move using the 3ds Max toolset. It gave you some basic animation techniques to help you develop your eye for motion. Don’t stop here. Go back into the chapter and redo some of the exercises.
Additional Exercises
Try different variations on the same themes, such as:
  • Bounce the ball on the floor and then off a wall. Try bouncing the ball off a table, onto a chair, and then onto the floor.
  • Animate three different types of balls bouncing next to one another, such as a bowling ball, a ping pong ball, and a tennis ball. Examples may be found at www.sybex.com/go/3dsmax2013essentials.
Most important, keep working at it!
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset