Chapter 7: Adding More Balls.

Duplicating Balls

To make the bouncing ball movie more interesting, and to have items to make comparisons when changing the surface properties in Chapter 8, we'll add some additional balls. First we need to briefly switch back to the 3DJoy Modeler module. After opening the model, go to one of the view windows and option-click and drag the cursor to where you want the duplicate ball to be located. Do this again to create a third ball.

To distinguish between the three balls, we'll change their colors and names. Click on one of the balls, then click in the color swatch in the toolbar and select a new color, say red. Then, double click on the ball, and rename it for it's new color. Do this for the third ball also. You may need to use the Re-display option under the Windows menu (or use Command D.) In figure 7-1, I have made three balls in a row: Red, Green, and Blue. Save the modified model and switch to the Animator module.

Script window.
Figure 7-1. Duplicating the Blue ball to create others.

After switching back to the Animator module, you will see the new balls in the Script window. Playing the movie in the Active Camera window shows the three balls moving together. When the ball was copied, the velocities and Attributes were also copied as can be seen with the identical markers.

On a side note, objects in the Script window can be grouped into folders. Folders can be created by using the New Folder item in the Action menu (or by using Command N.) Folders will display their contents if they are open. The grey flippy triangle next to the folder points down if the folder is open. Objects can be moved into folders by dragging it's label and dropping it on an open folder. You can tell if an object is contained in a folded as it will be indented in the listing (and will disappear from view if the folder is closed by clicking on the flippy triangle.) I have created a Balls folder and moved the balls into it in Figure 7-2

Script window.
Figure 7-2. Script window showing the new Balls folder and the balls grouped together.

Modifying the Movements

To make the movie more interesting, we'll give each ball a different velocity. Opening the Red ball's properties at time 0.00 shows that it has inherited the Gravity and Collisions Attributes as well as the initial velocity of 1 in the x direction. Instead, let's have this ball start with an upward motion before falling, so we'll change the y (up) velocity to 3, and x to 0. We can change the Green ball's x velocity to 2 so that it will collide with the Blue ball. These new velocities are displayed in figure 7-3.

Balls' properties boxes.
Figure 7-3. The properties boxes for the three balls at time 0.00.

When we close the properties boxes and then choose the Re-Calculate Interactive from the Action menu (Command R,) we see the balls start moving as expected in the Active Camera window, but then they suddenly jump and their motion is as before! What happened?!

The answer is the Sound Attributes effects that were added in Chapter 6 and copied to the other balls when the Blue ball was duplicated. The points in the script that have the modified properties and Attributes are indicated by the red squares. If an Attribute is added to an object in the script,the position and velocity information is fixed, and can only be changed manually or by deleting the marker. To delete a group of markers, click and drag a rectangle in the Script window to select the desired markers (markers darken when they are selected.) Then press the Delete key.

Once the old (red square) markers are removed, the motion can be calculated with the Re-Calculate Interactive menu item. The new motion can be seen in the Active Camera window and the Script will look similar to that in figure 7-4.

Script window.
Figure 7-4. The recalculated Script. The Green and Blue balls collide and bounce at the same time so they have markers at the same place in the Script window.

Next, we'll modify the surface properties of objects, map pictures to objects, and finish the tutorial by playing with camera motion.


Next: Surface Properties and Picture Mapping.

Last: Adding More Balls

Back to the index.

©1999 Steven Sahyun - sahyuns@ucs.orst.edu