MACROMEDIA DIRECTOR MX-USING DIRECTOR MX Use Manual page 525

Table of Contents

Advertisement

Vector creation commands
Use these functions to create vectors:
Function
vector
(x,y,z)
random
Vector()
Vector properties
Use these properties to work with vectors:
Property
magnitude
length
[
]
index
x
y
z
Vector commands
Use these commands to work with vectors:
Command
normalize()
get
Normalized()
dot(
)
vector2
angleBetween
(
)
vector2
cross(
)
vector2
or
crossProduct
(
vector2
)
or
perpendicular
To(
)
vector2
Description
Creates a vector from arguments representing all axes.
Creates a vector describing a randomly chosen point on the
surface of a unit sphere. Differs from
10.0
random(10)/10.0
,
randomVector()
the
method always results in a unit vector.
Access
Description
Get
The magnitude of the vector. Equivalent to the length of the
vector.
Get
The length of the vector. Equivalent to the magnitude of the
vector.
Get and set
Returns the value of a vector at a specified point in an index
between 1 and 3.
Get and set
The x component of a vector.
Get and set
The y component of a vector.
Get and set
The z component of a vector.
Description
Normalizes the vector by modifying it into a unit vector of length
1. This is done by dividing each component of the vector by the
vector's original length. That original length is the square root of
the sum of the squares of each component.
Returns a normalized version of the vector.
Returns the dot (inner) product of the first vector and the second
vector2
vector (
). If both vectors are of unit length, the result is
the cosine of the angle between the two vectors.
Returns the angle between
Returns a vector perpendicular to the original vector and to
vector2
.
vector(random(10)/
random(10)/10.0)
,
because
vector
vector2
and
, in degrees.
Returns
A vector object
A unit vector
Returns
Nothing. Vector is
modified.
A new vector object.
Dot product of the two
vectors.
Value of the angle in
degrees.
A new vector object.
Controlling the 3D World 525

Advertisement

Table of Contents
loading

This manual is also suitable for:

Director mx

Table of Contents