Tutorial 101: 2D-3D Parallax

Joe Clay | Dec 15, 2017

This week we look at a useful way to map a precomp's frames to its position on screen. This allows us to fake a 3D rotation as things move across screen. You basically animate shape layers to the extreme positions, add our expression, and you're done. You can also do this with 3D layers. Just rotate them a little bit and bring them in. In this example I animated the trees by putting a null in the middle of them, parenting a camera to that null, and then rotating the null 60° over 180 frames. Then, back in After Effects, you can either parent these layers to a null and animate the null's position or just animate their position directly.

Layer Dolly

//Remap time to rotate house as they dolly by
s = this.source.name;
end = comp(s).duration;
x = this.toWorld(this.anchorPoint)[0];
linear(x,2052,-152,0,end);

This was changed from the version in the video where the duration of the layer was hard coded into the expression. This will grab the duration of the layer from its source precomp. That should allow the precomps to be at a different frame rate from the main comp if that is desired.

If you have any questions, ask them. If not, see you next week!

Become a Patron

If you'd like to help support Workbench, check out our Patreon page. For $5 a month, you get access to all of the tutorial project files we've made available as well as other monthly projects, rigs, R&D, elements, early product previews, and BTS content not available anywhere else!

Check out our Patreon Today