beautypg.com

Random numbers methods – Adobe After Effects CS3 User Manual

Page 568

background image

AFTER EFFECTS CS3

User Guide

563

div(vec, amount)

Return type: Array.

Argument type: vec is an Array, amount is a Number.

Divides every element of the vector by the amount.

clamp(value, limit1, limit2)

Return type: Number or Array.

Argument type: value, limit1, and limit2 are Numbers or Arrays.

The value of each component of value is constrained to fall between the values of the corresponding values of limit1
and limit2.

dot(vec1, vec2)

Return type: Number.

Argument type: vec1 and vec2 are Arrays.

Returns the dot (inner) product of the vector arguments.

cross(vec1, vec2)

Return type: Array [2 or 3].

Argument type: vec1 and vec2 are Arrays [2 or 3].

Returns the vector cross product of vec1 and vec2. Refer to a math reference or JavaScript guide for more infor-
mation.

normalize(vec)

Return type: Array.

Argument type: vec is an Array.

Normalizes the vector so that its length is 1.0. This is a short way of writing

div(vec, length(vec))

.

length(vec)

Return type: Number.

Argument type: vec is an Array.

Returns the length of vector vec.

length(point1, point2)

Return type: Number.

Argument type: point1 and point2 are Arrays.

Returns the distance between two points. The point2 argument is optional. For example,

length(point1, point2)

is the same as

length(sub(point1, point2))

.

lookAt(fromPoint, atPoint)

Return type: Array [3].

Argument type: fromPoint and atPoint are Arrays [3].

The argument fromPoint is the location in world space of the layer you want to orient. The argument atPoint is the
point in world space you want to point the layer at. The return value can be used as an expression for the Orientation
property, making the layer’s z-axis point at atPoint. This method is especially useful for cameras and lights. If you use
this on a camera, turn off auto-orientation. For example, this expression on the Orientation property of a spot light
makes the light point at the anchor point of layer number 1 in the same composition:

lookAt(position,

thisComp.layer(1).position)

Random Numbers methods

seedRandom(offset, timeless=false)

Return type: none.

Argument type: offset is a Number, timeless is a Boolean.