Working with 3D Sprites
A 3D cast member, like any other visual cast member, can be made into a sprite by dragging it to the Stage or Score.
A 3D sprite can be tweened and resized, but it can't be rotated or skewed. When you resize a 3D sprite, you can change its bounding box in any way you like, but the 3D objects within the sprite always maintain their proportions ( Figure 18.39 ).
Figure 18.39. All 3D objects within a sprite retain their proportions when the sprite is resized.
When talking about 3D sprites, it's important to distinguish between the 3D sprite itselfan ordinary object on the Director Stageand the 3D world contained within the 3D sprite. You can use tweening to animate a 3D sprite, but in doing so you're only moving the sprite around on the Stage; you're not animating the models, lights, cameras , and other objects that populate the 3D world ( Figure 18.40 ). If you want to create animation within the 3D world, the best place to do so is in the 3D program that originally created the file.
Figure 18.40. This 3D sprite has been tweened across the Stage like any ordinary sprite.
If you don't have access to 3D software (or if you want to animate 3D text that was created in Director), you can use Lingo to animate the contents of a 3D world. The required Lingo is too advanced for this book, but as a starting point Director provides a behavior in the Library palette that can place a 3D object in motion. It's described in "To rotate a 3D object" on the next page.
To turn a 3D cast member into a sprite:
To make the background of a 3D sprite invisible:
Select a 3D sprite on the Stage or in the Score.
Select the Sprite tab in the Property Inspector.
Choose Background Transparent, Transparent, or Blend from the Ink menu.
The background of the 3D sprite disappears, irrespective of which background colors are set in the Property Inspector or on the Tool palette.
The Background Transparent, Transparent, and Blend ink effects are the only ink effects that work with a 3D sprite. Their only effect is to make the background disappear; they don't change the appearance of the 3D sprite in any other way.
To rotate a 3D object:
Choose Window > Palette to open the Library palette.
Choose 3D > Actions from the Library List pop-up menu ( Figure 18.41 ).
Figure 18.41. From the Library List pop-up menu, choose 3D > Actions.
The list of 3D actions appears. (To learn more about these actions, see the next section, "Making 3D Sprites Interactive.")
Find the Automatic Model Rotation behavior and drag it from the Library palette ( Figure 18.42 ).
Figure 18.42. The Automatic Model Rotation behavior in the Library palette.
On the Stage or in the Score, drop the behavior on a 3D sprite containing an object that you want to rotate.
The Parameters dialog box appears ( Figure 18.43 ).
Figure 18.43. When you drop the behavior on a 3D sprite that contains an object you want to rotate, the Parameters dialog box appears, prompting you to adjust settings for that object.
In the Parameters dialog box, use the "Rotation speed" slider to select a speed at which you want the object to rotate.
The available speeds range from -20 to 20. Rotation at a negative speed goes in the opposite direction from rotation at a positive speed. The numbers are arbitrary (they don't refer to rotations per minute or anything similarly measurable), so you'll have to experiment to find the speed you want.
If the 3D world contains more than one object, choose the one you want to rotate from the "Which model?" pop-up menu.
If you want to rotate all the objects, select Rotate All.
Use the "Which axis to rotate about" pop-up menu to select the x -, y -, or z -axis.
Click OK to close the dialog box.
If you want a single object to rotate in more than one direction, or if you want more than one object within the 3D world to rotate, repeat steps 3 through 8 (but drag the behavior from the Cast window instead of the Library palette).
You can apply an unlimited number of instances of this behavior to a sprite, specifying different parameters for each instance.
Play the movie.
Within the 3D sprite, the specified object or objects rotate in the specified manner ( Figure 18.44 ).
Figure 18.44. A 3D sprite with the Automatic Model Rotation behavior applied.