
Transforms
401
Transform methods
Use these methods to work with transforms:
Method
Description
Returns
rotate
(
xAngle,
yAngle, zAngle
)
Applies a rotation transformation after the current
transformation:
model.transform.identity()
model.transform.translate(100,0,0)
model.transform.rotate(0,0,90)
After this series of transformations, performed in this order, the
model’s local origin will be at
(0,100,0)
, assuming the model’s
parent is the world.
Nothing
preRotate
(
xAngle,
yAngle, zAngle
)
Applies a rotation transformation before the current
transformation:
model.transform.identity()
model.transform.translate(100,0,0)
model.transform.preRotate(0,0,90)
After this series of transformations, performed in this order, the
model’s local origin will be at
(100,0,0)
, assuming the model’s
parent is the world.
Nothing
rotate
(
point,
vector, angle
)
Similar to
transform.rotate(
xAngle, yAngle, zAngle
)
, except
that the arguments are two vectors specifying an axis of
rotation as a point and a vector, plus an angle specifying the
clockwise rotation around that axis:
model.transform.identity()
model.transform.translate(-50,0,0)
model.transform.rotate(vector(100,0,0) vector(0,1,0))
After this series of transformations, performed in this order, the
model’s local origin will be at
(250,0,0)
, assuming the model’s
parent is the world.
Nothing
preRotate
(
point,
vector, angle
)
Similar to
transform.preRotate(
xAngle, yAngle, zAngle
)
,
except that the arguments are two vectors specifying an axis of
rotation as a point and a vector, plus an angle specifying the
clockwise rotation around that axis.
model.transform.identity()
model.transform.translate(-50,0,0)
model.transform.preRotate(vector(100,0,0)
vector(0,1,0))
After this series of transformations, performed in this order, the
model’s local origin will be at
(150,0,0)
, assuming the model’s
parent is the world.
Nothing
translate
(
xIncrement,yInc
rement,zIncremen
t
)
Translates the position of the transform relative to the
transform’s current orientation:
model.transform.identity()
model.transform.rotate(0,90,0)
model.transform.translate(100,0,0)
After this series of transformations, performed in this order, the
model’s local origin will be at
(100,0,0)
, assuming the model’s
parent is the world.
Nothing
Summary of Contents for DIRECTOR MX 2004-USING DIRECTOR
Page 1: ...DIRECTOR MX 2004 Using Director...
Page 16: ...16 Chapter 1 Introduction...
Page 82: ...82 Chapter 3 Sprites...
Page 98: ...98 Chapter 4 Animation...
Page 134: ...134 Chapter 5 Bitmaps...
Page 242: ...242 Chapter 10 Sound and Synchronization...
Page 274: ...274 Chapter 11 Using Digital Video...
Page 290: ...290 Chapter 12 Behaviors...
Page 302: ...302 Chapter 13 Navigation and User Interaction...
Page 334: ...334 Chapter 15 The 3D Cast Member 3D Text and 3D Behaviors...
Page 392: ...392 Chapter 16 Working with Models and Model Resources...
Page 418: ...418 Chapter 18 Movies in a Window...
Page 446: ...446 Chapter 22 Managing and Testing Director Projects...