Using Help | Contents | Index Back - Adobe AFTER EFFECTS 5.5 Help Manual

Table of Contents

Advertisement

Adobe After Effects Help
Using Help
|
Contents
The letter x is equivalent to the index 0, and the letter y is equivalent to the index 1.
Using mathematical functions and operations on vectors (PB
only)
In assignments, vector variables can be treated exactly as other variables, except that any
function or mathematical operation applied to a vector is applied to each dimension,
unless an index is used. In the following example, both dimensions of the position vector
for the boat layer are multiplied by 1.5 and then assigned to the variable M2:
M2 = value (boat, position) * 1.5;
In another example, only the first dimension of the position vector is multiplied by 1.5:
M2 = value (boat, position) [0] * 1.5;
Performing vector operations (PB only)
Motion Math includes three functions that are special to vectors: dot product, cross
product, and distance.
The dot product of two vectors produces a single value. It multiplies the same indexed
values together and adds the products, as shown below:
V = {x, y}
W = {a, b}
V • W = x*a + y*b
The Motion Math dot-product function uses the following format, in which a and b are
vectors:
dot (a, b)
The cross product of two vectors produces a third vector, which is perpendicular to the
plane formed by the other two and points in the direction indicated by the coordinate
system. The cross product of two vectors produces a vector with the same number of
dimensions. The Motion Math cross-product function uses the following format, in which
a and b are vectors:
cross (a, b)
The distance between two vectors can be determined if each vector is plotted as a point in
a coordinate system. The Motion Math distance function uses the following format, in
which a and b are vectors:
dist (a, b)
The resulting value is in pixels. You can use the Motion Math distance function to calculate
the distance between two layers, using vectors for the Position property.
Using the Layer, Property, and Channel menus (PB only)
To allow easy substitution of different layers and parameters into Motion Math scripts, use
the Layer, Property, and Channel menus to select layers, properties, or channels, and then
run the script on the selected elements. In this way, you can quickly run a script on
different layers or compositions.
To write a script that uses these menus, include one or more of the substitution functions:
The pop_layer () function obtains the current selection from the specified Layer menu.
Using Help
|
Contents
|
Index
|
Index
Using Motion Math (PB only)
Back
328
Back
328

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents