User Guide

Chapter 20528
Transform commands
Use these commands to work with transforms:
y axis Get and set A vector representing the transform’s
canonical y axis in transform space. Example:
transform.identity()
transform.rotate(90,0,0)
put transform.yaxis
--vector(0,0,1)
vector
(0,1,0)
z axis
Get and set A vector representing the transform’s
canonical z axis in transform space. Example:
transform.identity()
transform.rotate(0,90,0)
put transform.zaxis
--vector(1,0,0)
vector
(0,0,1)
Command 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
Property Access Description Default