Building a 3D object
In order to move the book in 3D space, you’ll need to create the 3D object. You’ll build it piece by piece. Initially, any layer is flat, with only x (width) and y (height) dimensions and can be moved only along those axes. But all you have to do to move a layer in three dimensions is to turn on its 3D Layer switch. With that switch on, you can also manipulate the object along its z axis (depth).
Before you build the book, you’ll create an environment to help you work in perspective.
Creating the 3D floor
A grid layer, serving as a floor for the 3D space, can help you maintain perspective.
- Click in the Timeline panel to make it active.
- Choose Layer > New > Solid.
- In the Solid Settings dialog box, name the layer 3D Grid.
- Enter 800 pixels for the Width and the Height, and then click OK to create the layer.
With the 3D Grid layer selected in the Timeline panel, choose Effect > Generate > Grid.
The Effect Controls panel displays the Grid effect properties. You can customize the grid if you want to, but the default settings will work for this lesson. The grid is simply to help you see objects in perspective as you work.
- In the Timeline panel, expand the 3D Grid Transform properties. The Position property is 360, 240, the center of the composition. Whenever you add an element to the Timeline panel, its anchor point will be at this center point.
In the Timeline panel, select the 3D Layer switch () for the 3D Grid layer to give the layer three dimensions.
Three 3D Rotation properties appear in the Transform group for the layer, and properties that previously supported only two dimensions now display a third value for the z axis. In addition, a new property group named Material Options appears.
A color-coded 3D axis appears over the layer’s anchor point in the Composition window. The red arrow controls the x axis, the green arrow controls the y axis, and the blue arrow controls the z axis. At the moment, the z axis appears at the intersection of the x and y axes. The letters x, y, and z appear when you position the pointer over the corresponding axis. When you move or rotate the layer while the pointer is over a particular axis, the layer’s movement is restricted to that axis.
- In the Timeline panel, change the X Rotation angle to 90 degrees. The grid seems to disappear, but don’t worry—it’s still there!
Using 3D views
Sometimes the appearance of 3D layers can be deceptive. For example, a layer might appear to be scaling smaller along its x and y axes when it’s actually moving along the z axis. You can’t always tell from the default view in the Composition panel. The Select View Layout pop-up menu at the bottom of the Composition panel lets you divide the panel into different views of a single frame, so you can see your work from multiple angles. You specify the different views using the 3D View pop-up menu.
- At the bottom of the Composition panel, click the Select View Layout pop-up menu, and choose 2 Views – Horizontal. The left side of the Composition panel displays the Top view of the frame, and the right side displays the Active Camera view, which you’ve been viewing.
- Click in the left side of the Composition panel to make the Top view active. Orange corner tabs appear around the active view.
Choose Custom View 1 from the 3D View pop-up menu at the bottom of the panel.
In the Custom View 1 window, you can see that the layer is a grid that can offer true perspective in 3D space.
- Hide the properties for the 3D Grid layer in the Timeline panel.
- Choose File > Save to save your work so far.
Creating a guide layer
Guide layers help you position and edit elements in the Composition panel. For example, you can use guide layers for visual reference, audio timing, timecode reference, or even to store comments to yourself. In this project, you want to use the 3D Grid layer to help you place objects, but you don’t want to render it in the final artwork. You’ll convert it to a guide layer and lock it to ensure it stays in place.
- Select the 3D Grid layer in the Timeline panel, and choose Layer > Guide Layer. A cyan grid appears next to the layer name in the Timeline panel to indicate that it’s a guide layer.
- Select the Lock switch () for the 3D Grid layer in the Timeline panel to lock the layer.
Adding the first side of the object
With your grid in place as a guide layer, you’re ready to start building the book. What better place to start than the front cover?
- Click the Project tab to make the panel active. Then drag the AEFront.jpg item into the Timeline panel, placing it at the top of the layer stack, above the 3D Grid layer.
Select the 3D Layer switch () for the AEFront.jpg layer.
The book cover is much larger than the composition, and it intersects the grid. You’ll scale the AEFront.jpg layer later, after the entire object is built. But you’ll reposition the cover to rest firmly on the floor of the grid now. To do this, you’ll reposition the layer’s anchor point to the bottom of the book cover.
With the AEFront.jpg layer selected in the Timeline, press the A key to display the layer’s Anchor Point property.
Currently, the anchor point for the AEFront.jpg layer is in the center of the book. You want the anchor point to be at the bottom of the book cover, to match the anchor point at the center of the grid. Because the current y-axis value is at the center, and therefore halfway down the book, you can simply multiply that value by 2 for the new Anchor Point value.
- Click the y-axis value (the middle value), and add *2 to the value, so that it reads 617*2. Press Enter or Return to accept the calculation. The layer moves to sit on the grid.
Positioning 3D elements
When you build a 3D object, you need to position the 3D layers in relationship to each other. You’ll position the spine of the book by moving its anchor point and then adjusting the front cover as necessary.
- Drag the AESpine.jpg item from the Project panel into the Timeline panel, placing it at the top of the layer stack.
- Select the 3D Layer switch () for the AESpine.jpg layer.
- Ctrl-click (Windows) or Command-click (Mac OS) the triangle in the Label column for the AESpine.jpg layer to display all of its Transform properties.
Click the y-axis value (the middle value) for the Anchor Point property, and then add *2, so that its value is 617*2. Press Enter or Return to accept the calculation.
As with the front cover, moving the anchor point for the spine positions it to sit on the floor of the 3D space. However, the spine is facing the same direction as the front cover. You’ll need to rotate it.
Change the Y Rotation property for the AESpine.jpg layer to +90.
Now the spine is facing the right direction, but it’s in the middle of the front cover. To move it into place, you’ll use the same simple math trick you used to position the book on the floor.
Select the AEFront.jpg item in the Project panel, and note its width. It’s exactly 1000 pixels wide.
The AESpine.jpg layer currently intersects the middle of the AEFront.jpg layer. Therefore, moving the spine 500 pixels to the left will align it appropriately. To move an object to the left on the x axis, subtract pixels.
In the Timeline panel, click the x-axis value (the first value) for the Position property, and then append -500 to the value, so the new value is 360.0-500. Press Enter or Return.
The spine moves to the end of the book. It’s close, but it protrudes from the front of the book. You’ll move the AEFront.jpg layer forward to fix that.
- In the Timeline panel, select the AEFront.jpg layer, and then press P to display its Position property.
Click the z-axis value (the third value) for the Position property of the AEFront.jpg layer, and change the value to -56. A negative value on the z axis moves the layer toward the active camera view (forward).
- Close all properties for the AESpine.jpg and AEFront.jpg layers to keep the Timeline panel neat.
Replacing a 3D element with another
Instead of repeating all the steps to position the back cover, you’ll duplicate the front cover and replace it with the back cover.
- Select the AEFront.jpg layer in the Timeline panel, and press Ctrl+D (Windows) or Command+D (Mac OS) to duplicate the layer.
- With the duplicate layer selected, press P to display its Position property.
- Change the z-axis value to +56 to move the layer away from the active camera view. Because this will be the back cover, you want to position it at the back of the spine, which is 112 pixels wide.
In the Composition panel, change the right view to Custom View 3 so you can see both ends of the book.
- With the duplicate layer selected in the Timeline panel, press R to display the layer’s Rotation properties, and change its Y Rotation value to 180 degrees. The rotation flips the layer.
- With the duplicate layer selected in the Timeline panel, press Alt (Windows) or Option (Mac OS) as you drag the AEBack.jpg item from the Project panel onto the duplicate layer. After Effects replaces the front cover with the back cover, and changes the layer name to AEBack.jpg.
Adjusting views with the camera tools
By definition, 3D objects can appear different from different angles. You can adjust the camera view to see the object from other directions so that you can identify gaps, make positioning adjustments, and otherwise evaluate and plan your project.
- Select the Track Z Camera tool (), hidden behind the Unified Camera tool () in the Tools panel. The Track Z Camera tool lets you zoom in and out of a composition view.
Click in the left view (Custom View 1) in the Composition panel to ensure it’s active. Then click and drag to the left or down to zoom out from the scene and see the entire book. You may need to click and drag multiple times.
- Select the Orbit Camera tool (), hidden behind the Track Z Camera tool in the Tools panel. The Orbit Camera tool rotates the current 3D view by moving the camera around the point of interest.
- Drag the Orbit Camera tool to the left or right in the left view of the Composition window so that you can see the back of the book. Remember, when you’re using the Orbit Camera tool, you’re rotating the view, not the object itself.
- Drag the Orbit Camera tool again so that you are viewing the front of the book.
- Select the Selection tool () in the Tools panel, and choose File > Save to save your work so far.
Adding solid layers to a 3D object
You’ve assembled the front cover, back cover, and spine of the book. But it’s still lacking a top and right side (opposite the spine). Because these sides don’t require specific content, you can create them using solid layers.
- Click in the Timeline panel. Then press Ctrl+Y (Windows) or Command+Y (Mac OS) to create a new solid layer.
- In the Solid Settings dialog box, name the layer Top Pages, change the width to 1000 pixels (to match the cover width), and the height to 112 pixels (to match the width of the spine).
- Click the eyedropper, and click a white area of the book cover to sample it. Click OK to create the layer.
- Select the 3D Layer switch () for the Top Pages layer.
- Press R to display the Rotation properties, and change the X Rotation property to 90 degrees.
Press P to display the Position property. Click the y-axis value, and type 240-1234. Press Enter or Return to accept the calculation.
Why those numbers? The current position is 240, and you want to move it up the height of the book, which is 1234 pixels.
- Press Ctrl+Y (Windows) or Command+Y (Mac OS) to create another solid layer for the right side of the book, representing the edges of the pages that are bound by the spine on the left side.
- In the Solid Settings dialog box, name the layer Pages, change the Width to 112 pixels (the width of the spine) and the Height to 1234 pixels (the height of the covers). Make sure the layer is white, and then click OK.
Select the 3D Layer switch () for the Pages layer.
The Pages layer needs to be on the right side of the book. You’ll change its Anchor Point, Rotation, and Position properties to get it there.
- Ctrl-click (Windows) or Command-click (Mac OS) the triangle next to the Label column for the Pages layer to display all its Transform properties.
- Change the y-axis value for the Anchor Point property to 1234 (placing the layer on the virtual floor); change the Y Rotation amount to 90° to make it face the right direction; and change the x-axis value for the Position property to 360+500 to move the layer to the right side of the book.
- With the Timeline panel active, press Ctrl+A (Windows) or Command+A (Mac OS) to select all the layers. Then press the U key to close all the properties for the layers.