Chapter 20
526
Vector binary operations
Use these syntaxes to perform additional vector math calculations:
Transforms
A transform is a data object describing a model’s position, orientation, and scale in the 3D world.
Transform functions can be used to move a given vector, light, camera, or model from its current
location to a new position and/or orientation.
Transform creation function
Use the
transform()
function to create a new
transform
data object:
distanceTo
(
vector2
)
Returns the distance between
vector
and
vector2
.
If these
vectors represent positions in the 3D world, this is the distance
between them.
Floating-point value of
distance.
duplicate()
A copy of the vector.
A new vector object.
Operator
Description
Returns
vector1
+vector2
Returns a new vector equaling
vector1
+vector2
for
x
equaling 1 through 3.
A new vector object
vector1 -
vector2
Returns a new vector equaling
vector1 -vector2
for
x
equaling 1 through 3.
A new vector object
vector1*
vector2
Returns the product of the two vectors.
A floating-point value
vector1/
vector2
Not supported.
0
vector2*scalar
Returns a new vector equaling
vector2 * scalar
for
x
equaling 1 through 3.
A new vector object
vector2/scalar
Returns a new vector equaling
vector2/scalar
.
A new vector object
transform*
vector
Returns a new vector resulting from applying the positional and
transformation changes defined by
transform
to
vector
.
Note that vector*transform is an invalid operation.
A new vector object
scalar-vector1
Returns a new vector equaling
scalar-vector1
.
A new vector object
vector1-scalar
Returns a new vector
equaling
vector1-scalar
.
A new vector object
vector1
Returns a new vector equaling
vector1
.
A new vector object
v
scalar
Returns a new vector equaling
v scalar
.
A new vector object
Function
Description
Returns
transform()
Creates a new transform initialized as the identity transform. The
identity transform has no rotation and a vector position of
(0,0,0)
A new transform object
Command
Description
Returns
Summary of Contents for DIRECTOR MX-USING DIRECTOR MX
Page 1: ...Using Director MX Macromedia Director MX...
Page 12: ...Contents 12...
Page 156: ...Chapter 4 156...
Page 202: ...Chapter 6 202...
Page 244: ...Chapter 7 244...
Page 292: ...Chapter 10 292...
Page 330: ...Chapter 12 330...
Page 356: ...Chapter 13 356...
Page 372: ...Chapter 14 372...
Page 442: ...Chapter 16 442...
Page 472: ...Chapter 18 472...
Page 520: ...Chapter 19 520...
Page 536: ...Chapter 20 536...
Page 562: ...Chapter 23 562...
Page 566: ...Chapter 24 566...
Page 602: ...Chapter 27 602...