Rotating a Layer to Face the Camera

One of the benefits of using 3D cameras is that they can be animated. For example, if your scene includes a 3D object, you can animate the camera easily by moving around the 3D object to see it from all sides. When such a motion is performed on a 2D object, however, the 2D object becomes skewed and eventually turns into a line when you look at the object from the side.

You can fix this behavior by enabling the Rotate to Face Camera option in the Layer Settings dialog box. When this option is enabled, the layer is automatically rotated to stay perpendicular to the camera, so as the camera moves, the 2D layer remains flat and visible. A 2D object that faces the camera at all times is often called a sprite.

Tip

Enabling the Rotate to Face Camera option for background objects like trees and mountains is a great way to make sure that a 2D background stays consistent as the camera moves.


To make a layer rotate with the camera, follow these steps:

1.
Open the Top on table.anme file from the Chapter 25 folder on the CD. This file is the file created at the end of the last tutorial with the top spinning.

2.
Click the New Layer button in the Layers palette to create a new layer. Name the new layer “tabletop” and drag the layer below the top layer.

3.
Click a brown color in the Style swatches to change the fill color and then select the Rectangle tool (E) and drag in the working area to create a filled rectangle over the bottom portion of the top.

4.
Click the Play button in the bottom-left corner of the main interface to see the top and the tabletop spinning around.

5.
Double-click the tabletop layer and enable the Rotate to Face Camera option in the Layer Settings dialog box. Then close the Layer Settings dialog box.

6.
Click the Play button again and notice how the table doesn’t appear to be rotating with the top anymore, as shown in Figure 25.12.

Figure 25.12. Spinning top with stationary table.


7.
If you select the View, Direction, Top menu command to switch to the top view, you’ll see that the top layer is still standing still and the table is rotating along with the camera.

..................Content has been hidden....................

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