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
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()
(100, 0, 0) and the model rotated about its own Y axis by 90°. The statement
model.transform.pretranslate(x, y, z)
Generally,
preTranslate()
model.transform
Parameters
Required if applying a translation using
xIncrement
around the
-axis.
x
Required if applying a translation using
yIncrement
around the
-axis.
y
Required if applying a translation using
zIncrement
around the
-axis.
z
Required if applying a translation using a vector. Specifies the vector to use in
vector
the translation.
,
, and
yIncrement
been used instead of
preTranslate()
is only useful when dealing with transform variables rather than
references.
, or by a vector, where the X component
zIncrement
, the model's local origin would be at
is equivalent to
model.translate(x, y, z)
-,
-, and
-axes. Specifies the translation
x
y
z
-,
-, and
-axes. Specifies the translation
x
y
z
-,
-, and
-axes. Specifies the translation
x
y
z
.
preTranslate()
473
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?
Questions and answers