preTranslate()
473
Line 4
assigns this new transform to Moon2.
t = member("scene").model("Moon1").transform.duplicate()
t.preScale(2,2,2)
t.rotate(180,0,0)
member("scene").model("Moon2").transform = t
preTranslate()
Usage
transformReference
.preTranslate(
xIncrement
,
yIncrement
, \
zIncrement
)
transformReference
.preTranslate(
vector
)
member(
whichCastmember
).
node
.transform.preTranslate\
(
xIncrement
,
yIncrement
,
zIncrement
)
member(
whichCastmember
).
node
.transform.preTranslate(
vector
)
Description
3D transform command; applies a translation before the current positional, rotational, and scale
offsets held by the referenced transform object. The translation may be specified as a set of three
increments along the three corresponding axes. These increments may be specified explicitly in
the form of
xIncrement
,
yIncrement
, and
zIncrement
, or by a vector, where the X component
of the vector corresponds to the translation about the X axis, the Y about the Y axis, and the Z
about the Z axis.
After a series of transformations are done, in the following order, the model’s local origin will be at
(0, 0, -100), assuming the model’s parent is the world:
model.transform.identity()
model.transform.rotate(0, 90, 0)
model.transform.preTranslate(100, 0, 0)
Had
translate()
been used instead of
preTranslate()
, the model's local origin would be at
(100, 0, 0) and the model rotated about its own Y axis by 90°. The statement
model.transform.pretranslate(x, y, z)
is equivalent to
model.translate(x, y, z)
.
Generally,
preTranslate()
is only useful when dealing with transform variables rather than
model.transform
references.
Parameters
xIncrement
Required if applying a translation using
x
-,
y
-, and
z
-axes. Specifies the translation
around the
x
-axis.
yIncrement
Required if applying a translation using
x
-,
y
-, and
z
-axes. Specifies the translation
around the
y
-axis.
zIncrement
Required if applying a translation using
x
-,
y
-, and
z
-axes. Specifies the translation
around the
z
-axis.
vector
Required if applying a translation using a vector. Specifies the vector to use in
the translation.
Summary of Contents for DIRECTOR MX 2004
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...