Animate a bouncing ball

In this tutorial, you will create a bouncing ball. You will first generate a model of a sphere and then you will animate it.

ball_ex1.png
The sphere with its local
axis moved to its lower end.

 

You will next move the local origin and axes of the sphere to its lower end, which currently sits on the origin of the reference plane.

Cic_3752.ENU.png With the Edit Axes tool click on the sphere.

 

This displays the local axes and origin of the sphere.

You will next add some basic animation to the sphere, change workspace to Rendering/Animation.

Cic_3734.ENU.png Activate the Keyframe tool and click on the sphere.

While nothing very visible happens, the sphere has been animated and a keyframe symbol appears in the Animation Time Line palette. Also, animation information has been entered in some of the other animation supporting palettes, as you will see soon.

Notice that there is a blue line in the graph that represents the Z position of the sphere. There are also two dots, one at each end of the blue line. These dots represent the keyframes of this track. The line between the two dots shows how the track is inn see that these white dots do not have to be on the blue line and that by moving them in different positions you can control the type and intensity of the motion at the respective keyframe.

 

anim_editor_ex1.png
The Animation Editor palette.

 

You can add more keyframes to tracks by activating the Insert tool ( Cic_8057.ENU.png ) and clicking in the graph where we want the new keyframe to be added. You will do such an insertion next.

On the line, between the blue dots, there are two white dots. These are at the ends of the leads, which are controls of the keyframes. You will see the list on the left side of the palette.

If you have difficulty inserting a keyframe at exactly the desired position, you can still adjust the position after the insertion has been made. While the keyframe is highlighted, its Time and Value are displayed in two numeric fields at the lower middle portion of the palette. If they do not show 56 and 0, you can type these numbers in.

 

You will next play the animation up to this point.

 

anim_editor_ex2.png
The Animation Editor palette.

 

If we want the sphere to bounce continuously, we can do it through the Animation Editor palette.

anim_editor_ex3.png
The Animation Editor palette.

 

In the graph area of the palette, you will see that the original line has been repeated as many times as necessary to fill the time span available for this animation. The repetitions are shown in a light blue line.

Minimize the Animation Editor palette and from the Animation Time Line palette, play the animation again. Observe how it plays continuously.

 

anim_editor_ex4.png
The Animation Editor palette before
adjusting any of its leads.
anim_editor_ex5.png
Changing the leads of the first and last
Keyframes, in the Animation Editor palette.

As you were playing the animation and the ball was bouncing up and down continuously, you must have noticed that its motion appeared unnatural and mechanical. In order to make the sphere bounce more naturally, we need to adjust the way in which the position of the sphere is interpolated between the keyframes.

Look at the middle keyframe. Notice the line with the white circles at its ends, coming out both sides of the keyframe. These are the leads that control how the curve enters and leaves the keyframe. You will next manipulate the leads to change how the sphere bounces.

anim_editor_ex6.png
Changing the leads of the middle
keyframe.

 

Extend one of the leads of the middle keyframe away from the keyframe (notice that the other lead extends equally). This makes the line formed at the middle keyframe look like an upside-down U. The middle keyframe corresponds to the upper end of motion of the sphere and the change we just made will make the sphere appear that it is hanging in the air a moment longer.

 

Advanced motion: squash and stretch

sphere_ex2.png
The sphere after being squashed.

In order to make the ball appear as though it interacts with the ground during the bounce, the sphere should be squashed as it bounces. Before we squash the sphere, however, we need to make the sphere contact the ground longer than it does currently.

anim_editor_ex7.png
Inserting a keyframe at 60, 0.

 

anim_editor_ex7.png
Adding a Scale Z track to the sphere.
anim_editor_ex7.png
The Scale Z track in the Animation Editor palette.

If you are setting up an animation that is meant to cycle many times, you will want the first keyframe to have the same value as the last keyframe. This will make a smooth transition between cycles.

 

The graph for the Scale Z track, in the Animation Editor palette should now look like the graph to the right.

anim_editor_ex7.png
Adjusting the Leads for more realistic behavior of the sphere.

You notice now that, as the sphere leaves the ground, it stretches up. It returns to its normal shape as it approaches the top of its flight.

anim_editor_ex7.png
The graph for the Scale X track.

 

 

This can be taken a step farther and given some lateral scale that is inversely proportional to the vertical scale. In other words, as the sphere is compressed vertically, it should expand horizontally.

Scale Y will be identical to Scale X and will thus be constructed by copying and pasting all the keyframes from one track to the other.

paste_controls_dialog.png
The Paste Control Points Options dialog.

Now, Scale X and Scale Y should be the same. Right click each and select Track Options.... Click on the After tab, from the menu under it select Repeat Normal.

 

Click play in the Animation Time Line palette to see the results of the animation.

spacer