Home / Articles / Adobe After Effects / Building 3D Objects in Adobe After Effects CS5

Building 3D Objects in Adobe After Effects CS5

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.

  1. Click in the Timeline panel to make it active.
  2. Choose Layer > New > Solid.
  3. In the Solid Settings dialog box, name the layer 3D Grid.
  4. Enter 800 pixels for the Width and the Height, and then click OK to create the layer.
  5. 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.

  6. 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.
  7. In the Timeline panel, select the 3D Layer switch (3d.jpg) 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.

  8. 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.

  1. 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.
  2. Click in the left side of the Composition panel to make the Top view active. Orange corner tabs appear around the active view.
  3. 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.

  4. Hide the properties for the 3D Grid layer in the Timeline panel.
  5. 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.

  1. 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.
  2. Select the Lock switch (lock.jpg) 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?

  1. 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.
  2. Select the 3D Layer switch (3d.jpg) 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.

  3. 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.

  4. 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.

  1. Drag the AESpine.jpg item from the Project panel into the Timeline panel, placing it at the top of the layer stack.
  2. Select the 3D Layer switch (3d.jpg) for the AESpine.jpg layer.
  3. 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.
  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. In the Timeline panel, select the AEFront.jpg layer, and then press P to display its Position property.
  9. 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).

  10. 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.

  1. Select the AEFront.jpg layer in the Timeline panel, and press Ctrl+D (Windows) or Command+D (Mac OS) to duplicate the layer.
  2. With the duplicate layer selected, press P to display its Position property.
  3. 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.
  4. In the Composition panel, change the right view to Custom View 3 so you can see both ends of the book.

  5. 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.
  6. 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.

  1. Select the Track Z Camera tool (z-camera.jpg), hidden behind the Unified Camera tool (unif_camera.jpg) in the Tools panel. The Track Z Camera tool lets you zoom in and out of a composition view.
  2. 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.

  3. Select the Orbit Camera tool (orbit_camera.jpg), 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.
  4. 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.
  5. Drag the Orbit Camera tool again so that you are viewing the front of the book.
  6. Select the Selection tool (selection-tool.jpg) 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.

  1. Click in the Timeline panel. Then press Ctrl+Y (Windows) or Command+Y (Mac OS) to create a new solid layer.
  2. 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).
  3. Click the eyedropper, and click a white area of the book cover to sample it. Click OK to create the layer.
  4. Select the 3D Layer switch (3d.jpg) for the Top Pages layer.
  5. Press R to display the Rotation properties, and change the X Rotation property to 90 degrees.
  6. 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.

  7. 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.
  8. 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.
  9. Select the 3D Layer switch (3d.jpg) 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.

  10. 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.
  11. 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.
  12. 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.
3. Working with a null object | Next Section Previous Section