(Close)
Forgot password?
AskAudio Magazine
Join Now! Watch Tutorials
macProVideo.com
Close

Join macProVideo.com

Access free tutorial videos, premium articles and project files.

Share this article with friends!

Create 3D Environments in Photoshop and After Effects

Check out our Photoshop: Drawing Objects In Photoshop CS4 course!

David Smith's MPVHub article "3D Perspective: Vanishing Point in Photoshop CS5" is a good introduction to the Vanishing Point filter in Photoshop. But did you know that in Photoshop CS3 Extended or later you can export Vanishing Point images you create with the filter into After Effects as full 3D scenes that you can then fly through? In this Feature Tutorial, we'll show you how to do it. Let's get started.


Step 1 - Find an Appropriate Image

First, of course, we need an image to work with. In choosing an image that will work well with the Vanishing Point filter, it helps to understand a bit how Vanishing Point itself works. Essentially, when you apply Vanishing Point to an image, you then need to define the major perspective planes in the image - the floor, the walls, the ceiling, and whatever other major planar objects might be in the image. This doesn't mean that you literally have to use an image that has a floor and a ceiling and so forth, but it does help if you have well-defined perspective planes in your image, along with a strong sense of perspective in the scene itself. In my case, I'll be using this shot from my wife's recent vacation of an ancient alleyway in Edinburgh, Scotland:

Source image


As you can see, we have a well-defined, if narrow, floor to the alley with parallel walls on either side, and a back "wall" that begins where the steps drop off. We can't see overhead, so we won't have to worry about the "ceiling" in this case.

Once we've defined the perspective planes in the image, exporting the whole thing to After Effects will create a composition containing a 3D object consisting of the planes you've defined, along with image files of the areas that will be mapped onto those planes and a 3D camera correctly (more or less) oriented in the scene. Then, we can animate the camera to "walk" down the alley, while After Effects automatically distorts the image maps with parallax to create the illusion of 3D space - all from a flat 2D image. 

(We won't go into detail here, but you can learn more about parallax in my MPVHub article "Parallax Tutorial: 2D to 3D with Photoshop & After Effects - Part 1".

So, to recap, a good source image for Vanishing Point work between Photoshop and After Effects will have a strong sense of perspective and well-defined walls, floors, and ceilings, or the equivalent.


Step 2 - Apply the Vanishing Point Filter

Next, after you've opened your image in Photoshop (note that you have to have the Extended version of Photoshop to use Vanishing Point), apply the Vanishing Point filter (Filter > Vanishing Point, or Command-Option-V) to open the Vanishing Point window:

Vanishing Point window


Step 3 - Create the First Perspective Plane

It's important that your first perspective plane be accurately placed, because all the other planes in the image will be derived from that - if the angles or corners of the first plane are off, the rest of the planes will be too, and you won't get the correct perspective when we animate our camera later.

So, make sure the Create Plane Tool is active, which it will be by default (it's the second one from the top in the toolbar).

Create Plane Tool


Click with it in the image in the far corner of the part of the image that will define one of your planes - the floor or bottom plane of the image is usually a good place to start, if it's well-defined. Once your first point is placed, move your cursor to the next adjacent corner (don't click and drag, just move), and you'll see a blue line follow the cursor. Line up that blue line with the edge of the perspective plane in your image, and click again to place the second point:

Placing points


NOTE: It's OK to place your second point beyond the edge of the image; in fact, it can be useful to do so to make sure your plane lines align correctly with the perspective plane in your image.

Following the same procedure, place the third point at the next adjacent perspective plane corner, and finish up with the fourth point at the last corner - unlike a selection, you don't need to click on the first point again to close the plane off. If you've placed your points correctly, you'll see a blue grid that defines your first plane:

The third point


If you see a red outline instead of the blue gird, it means that Photoshop isn't able to match the plane to the perspective plane in the image. Usually, though, you can easily fix that by dragging slightly on one of the white points in the corner of the red outline until it turns into the blue grid - if your initial placement was close at all, it should only take a little tweaking to get the blue grid.


Step 4 - Create the Second Perspective Plane

Next we need to define the second perspective plane, which will make one of the walls. So, hold down the Command key, click on one of the mid-points in the plane you just created, and drag upward along the plane of the wall - as you do, you'll see another complete plane (no need to place corners at this point) that follows the line of the wall, as Photoshop figures out the correct perspective alignment based on your first grid plane:

Getting the correct perspective alignment


Keep dragging the new plane upward until you hit the edge of the image - you'll see that the upper corner of the plane goes way off the image, which is OK. You'll also see that the new plane doesn't go all the way to the front of the wall, which we'll fix next. 


Step 5 - Adjust the Second Perspective Plane

Next, we need to drag the front edge of the second plane so that it lines up with the front edge of the visible wall. To do that, just grab the white edit point on the front edge (your cursor will have automatically changed to the Edit Plane Tool) and drag it so that the plane goes just off the edge of the image:

Working with the white edit point


We also need to do this with the upper part of the second plane, so grab one of the rearward white points and drag it upward so the plane completely covers the wall:

Covering the wall with the plane


Step 6 - Create the Remaining Perspective Planes

Following those same steps, Command-drag on the first grid (click on it first to display the white edit points) to create the opposite wall plane, then adjust it so it covers the wall (you may need to zoom out to drag it far enough to cover the wall, which you can do with Command-minus; Command-plus zooms back in, as you'd expect):

Covering the opposite wall


Finally, Command-click on the edit point at the far end of the first plane to drag out the rear "wall" plane. You may need to adjust its width a bit so it meets the edges of the side wall planes - to do that, just drag on one of the white edit points along the vertical edge of the plane. When you're done, you should have four planes that cover all the visible parts of the image (only the current selected plane will display as a grid): 

Four planes should now cover all parts of the image


Step 7 - Export the After Effects Files

Our last step here in Photoshop is to export our Vanishing Point image as an After Effects .vpe (Vanishing Point Exchange) file. To do that, click on the little Settings and Commands menu in the upper left of the window, and choose Export for After Effects (.vpe)...:

Save as a .vpe


You'll want to save this in a sub-folder of its own, as you'll be creating an After Effects .vpe file, a .3ds 3D object file, and a .png image file for each of the planes you created here. Once you've created your sub-folder and given the export an appropriate name, click OK in the Vanishing Point window and launch After Effects.


Step 8 - Import the .VPE Files

In After Effects, choose File > Import > Vanishing Point (.vpe) ... to open the files you exported from Photoshop. Locate the folder where you saved the export, and just choose the .vpe file - the others will come along automatically.

Once you do, you'll see a folder containing the .PNG files for each grid plane you create, and a .vpe Composition file. Double-click that to open it and see how it all turned out:

PNGs for each grid created


Step 9 - Adjust the .VPE Comp

What the...? As you can see, the whole image is rotated, which is obviously not what we want. This is one of the peculiarities of the Vanishing Point filter - you often get a rotated scene when you import it into After Effects. But that's easy enough to fix.

Look in your Layer window, and you'll see a Parent layer of which all the .PNG layers and their associated 3D objects are children. (Also notice the Camera which was automatically created on import.) To fix the rotation problem, select the Parent layer and type R to solo its Rotation property. You'll notice that the Z Rotation is set to an odd value:

The image rotated


You'd think that you could just set it back to zero and everything would be OK, but unfortunately that's often not the case. For me, I had to drag the Z Rotation value to -17° to get it to look right - your mileage will vary, no doubt:

manually adjust the Z value


Step 10 - Animate a Walkthrough

Now, finally, after all that, we get to do something cool - a little walk down the alley. The imported VPE comp defaults to 30 seconds, which you may want to shorten - I've made mine 10 seconds long. Next, open the Transform properties for the Camera in the comp, and set a keyframe for Position at 0:00 in your Timeline. Then move to the 10 second point, and drag the Z Position value for the Camera in the positive direction to move the camera down the alley. 

How far you go is up to you, of course - you'll notice that eventually you'll start seeing some blurring and distortion of the side wall imagery, as there's less and less available resolution in the image the further in you go, but it's still pretty miraculous how convincing the effect can be. To finish it up, apply the Easy Ease Keyframe Assistant to your Camera Z Position keyframes, and preview the result:


And that's how you create navigable 3D environments from flat images using Photoshop and After Effects. As always, experiment and have fun.


Check out our Photoshop: Drawing Objects In Photoshop CS4 course!

Richard Lainhart

Richard Lainhart | Articles by this author

Richard Lainhart is an award-winning composer, filmmaker, and author. His compositions have been performed in the US, Europe Asia, and Australia, and recordings of his music have appeared on the Periodic Music, Vacant Lot, XI Records, Airglow Music, Tobira Records, Infrequency, VICMOD, and ExOvo labels. His animations and short films have been shown in festivals in the US, Europe, and Asia, and online at ResFest, The New Venue, The Bitscreen, and Streaming Cinema 2.0. He has authored over a dozen technical manuals for music and video hardware and software, served as Contributing Editor for Interactivity and 3D Design Magazines, and contributed to books on digital media production published by IDG, Peachpit Press, McGraw Hill, and Miller Freeman Books. Previously an Adobe Certified Expert in After Effects and Premiere, a demo artist for Adobe Systems, and co-founder of the official New York City After Effects User Group, he was, from 2000-2009, Technical Director for Total Training Productions, an innovative digital media training company based in New York and California.

Comments

You must be logged in to post a comment.
Create an Account  Login Now

What is macProVideo.com?

macProVideo.com is an online education community featuring Tutorial-Videos & Training for popular Audio & Video Applications including Adobe CS, Logic Studio, Final Cut Studio, and more.
© 2014 macProVideo.com
a division of NonLinear Educating Inc.

About

Our Plans

Tutorials

Community

Help

Legal

Link