Monday 28 January 2013

Layer Space Transforms


Layer Space Transforms

In the world of expressions, layer space transforms are
indispensible, but they present some of the most diffi cult
concepts to grasp. There are three coordinate systems in
After Effects, and layer space transforms provide you with
the tools you need to translate locations from one coordinate
system to another.
One coordinate system represents a layer’s own space. This
is the coordinate system relative (usually) to the layer’s
upper-left corner. In this coordinate system [0, 0] represents
a layer’s upper-left corner, [width, height] represents
the lower-right corner, and [width, height]/2 represents
the center of the layer. Note that unless you move a layer’s
anchor point, it too will usually represent the center of the
layer in the layer’s coordinate system.

The second coordinate system represents world space. World
coordinates are relative to [0, 0, 0] of the composition.
This starts out at the upper-left corner of a newly created
composition, but it can end up anywhere relative to the
comp view if the comp has a camera and the camera has
been moved, rotated, or zoomed.
The last coordinate system represents comp space. In this
coordinate system, [0, 0] represents the upper-left corner
of the camera view (or the default comp view if there is no
camera), no matter where the camera is located or how it is
oriented. In this coordinate system, the lower-right corner
of the camera view is given by [thisComp.width, thisComp.
height]. In comp space, the Z coordinate really doesn’t
have much meaning because you’re only concerned with
the fl at representation of the camera view (Figure 10.8).
So when would you use layer space transforms? One of the
most common uses is probably to provide the world coordinates
of a layer that is the child of another layer. When you
make a layer the child of another layer, the child layer’s
Position value changes from the world space coordinate
system to layer space of the parent layer. That is, the child
layer’s Position becomes the distance of its anchor point

from the parent layer’s upper-left corner. So a child layer’s
Position is no longer a reliable indicator of where the layer
is in world space. For example, if you want another layer
to track a layer that happens to be a child, you need to
translate the child layer’s position to world coordinates.
Another common application of layer space transforms
allows you to apply an effect to a 2D layer at a point that
corresponds to where a 3D layer appears in the comp view.
Both of these applications will be demonstrated in the following
examples.


No comments:

Post a Comment