rotate
Usage
member(whichCastmember ).node(whichNode ).rotate(xAngle , yAngle , zAngle {, relativeTo })
member(whichCastmember ).node(whichNode ).rotate(rotationVector {, relativeTo })
member(whichCastmember ).node(whichNode ).rotate(position, axis, angle {, relativeTo })
transform .rotate(xAngle , yAngle , zAngle {, relativeTo })
transform .rotate(rotationVector {, relativeTo })
transform .rotate(position , axis , angle {, relativeTo })
Description
3D command; applies a rotation after the current positional, rotational, and
scale offsets held by the node’s transform object or the directly referenced
transform object. The rotation must be specified as a set of three angles, each
of which specify an angle of rotation about the three corresponding axes. These
angles may be specified explicitly in the form of xAngle ,
yAngle , and zAngle , or by a
rotationVector , where the x component of
the vector corresponds to the rotation about the X axis, y
about Y axis, and z about Z axis. Alternatively, the
rotation may also be specified as a rotation about an arbitrary axis passing
through a point in space.
Parameters
xAngle Required if applying a rotation using
x -, y -, and z -axes.
Specifies the angle of rotation about the x -axis. (Определяет угол вращения по x-axis)
yAngle Required if applying a rotation using
x -, y -, and z -axes.
Specifies the angle of rotation about the y -axis.
zAngle Required if applying a rotation using
x -, y -, and z -axes.
Specifies the angle of rotation about the z -axis.
rotationVector Required if applying a rotation using a
vector. Specifies the vector that contains the angles to apply.
position Required if applying a rotation about an
arbitrary axis passing through a point in space. Specifies position in
space.(Определяет позицию в пространстве)
axis Required if applying a rotation about an arbitrary
axis passing through a point in space. Specifies the axis(ось) passing through the
specified position position .
angle Required if applying a rotation about an arbitrary
axis passing through a point in space. Specifies the amount of rotation about
the axis axis .
relativeTo Optional. Specifies which coordinate system
axes are used to apply the desired rotational changes. The
relativeTo parameter can have any of the following
values: Дополнительный. Определяет, что какая система координат осей использована, чтобы прилагать желаемые вращающиеся изменения.
Параметр relativeTo может иметь любое из следующих величин:
#self applies the increments relative to the node’s local
coordinate system (the X, Y and Z axes specified for the model during
authoring). This value is used as the default if you use the rotate
command with a node reference and the relativeTo parameter
is not specified.
#parent applies the increments relative to the node’s parent’s
coordinate system. This value is used as the default if you use the
rotate command with a transform reference and the
relativeTo parameter is not specified.
#world applies the increments relative to the world coordinate
system. If a model’s parent is the world, than this is equivalent to using
#parent .
nodeReference allows you to specify a node to base your
rotation upon, the command applies the increments relative to the coordinate
system of the specified node.
Example
The following example first rotates the model named Moon about its own Z axis
(rotating it in place), then it rotates that same model about its parent node,
the model named Earth (causing Moon to move orbitally about Earth).
member("Scene").model("Moon").rotate(0,0,15)
member("Scene").model("Moon").rotate(vector(0, 0, 5), member("Scene").model("Moon"))
The following example rotates the model Ball around a position in space
occupied by the model named Pole. The effect is that the model Ball moves in
orbit around Pole in the x-y plane.
polePos = member("3d Scene").model("Pole").worldPosition
member("3d Scene").model("Ball").rotate(polePos, vector(0,0,1), 5, #world)
- If you want to rotate the car 20°
around the world y-axis, with the rotation taking place at the world
location vector (10, 10, 10), use
model.rotate(vector(10,10,10),
vector(0,1,0), 20, #world) .
Пращение вокруг своей оси
member(whichCastmember ).node(whichNode ).rotate(xAngle , yAngle , zAngle {, relativeTo }
member("myTest").model("Sphere01").rotate(5,0,0)
member("myTest").model("Sphere01").rotate(0,5,0)
member("myTest").model("Sphere01").rotate(0,0,10)
Пращение вокруг орбиты
member(whichCastmember ).node(whichNode ).rotate(position, axis, angle {, relativeTo }
1 #world Вокруг глобальной орбиты
member("myTest").model("Sphere02").rotate(vector(0,0,0), vector(0,0,1), 5, #world)
или
member(whichCastmember ).node(whichNode ).rotate(rotationVector {, relativeTo })
member("myTest").model("Sphere02").rotate(vector(0,0,5), #world)
2
relativeTo -Вокруг заданной орбиты
member("myTest").model("Sphere03").rotate(vector(0,0,0), vector(0,0,1), 5,member("myTest").model("Sphere02"),)
See also
pointAt , preRotate , rotation (transform) ,
rotation (engraver
shader) , rotation
(backdrop and overlay) , preScale() , transform (property)
preRotate
Usage
transformReference .preRotate( xAngle , yAngle , zAngle )
transformReference .preRotate( vector )
transformReference .preRotate( positionVector , directionVector , angle )
member( whichCastmember ).node .transform.preRotate( xAngle, yAngle, zAngle )
member( whichCastmember ).node .transform.preRotate( vector )
member( whichCastmember ).node .transform.preRotate( positionVector , directionVector , angle )
Description
3D transform command; applies a rotation before the current positional,
rotational, and scale offsets held by the referenced transform object. The
rotation may be specified as a set of three angles, each of which specify an
angle of rotation about the three corresponding axes. These angles may be
specified explicitly in the form of xAngle , yAngle ,
and zAngle , or by a vector, where the x component of the vector
corresponds to the rotation about the x-axis, the y about the
y-axis, and the z about the z-axis.
Alternatively, the rotation may also be specified as a rotation about an
arbitrary axis. This axis is defined in space by
positionVector and directionVector . The
amount of rotation about this axis is specified by
angle .
Node may be a reference to a model, group, light, or
camera
Parameters
xAngle Required if applying a rotation using
x -, y -, and z -axes.
Specifies the angle of rotation around the x -axis.
yAngle Required if applying a rotation using
x -, y -, and z -axes.
Specifies the angle of rotation around the y -axis.
zAngle Required if applying a rotation using
x -, y -, and z -axes.
Specifies the angle of rotation around the z -axis.
vector Required if applying a rotation using a vector.
Specifies the vector whose angles are used in the rotation.
positionVector Required if applying a rotation about an
arbitrary axis. Specifies the position offset.
directionVector Required if applying a rotation about an
arbitrary axis. Specifies the direction offset.
angle Required if applying a rotation about an arbitrary
axis. Specifies the amount of rotation about an arbitrary axis.
Example
The following statement performs a rotation of 20° about each axis. Since the
model’s transform property is its position, rotation, and scale
offsets relative to that model’s parent, and preRotate applies the
change in orientation prior to any existing effects of that model's
transform , this will rotate the model in place rather than orbiting
around its parent.
member("scene").model("bip01").transform.preRotate(20, 20, 20)
The above is equivalent to:
member("scene").model("bip01").rotate(20,20,20).
Generally preRotate() is only useful when dealing with transform
variables. This line will orbit the camera about the point (100, 0, 0) in space,
around the y axis, by 180°.
t = transform()
t.position = member("scene").camera[1].transform.position
t.preRotate(vector(100, 0, 0), vector(0, 1, 0), 180)
member("scene").camera[1].transform = t
rotation (transform)
Usage
member(whichCastmember ).node(whichNode ).transform.rotation
member(whichCastmember ).node(whichNode ).getWorldTransform().rotation
transform .rotation
Description
3D property; allows you to get or set the rotational component of a
transform. A transform defines a scale, position and rotation within a given
frame of reference. The default value of this property is
vector(0,0,0) .
A node can be a camera, group, light or model object. Setting the
rotation of a node’s transform defines that object’s rotation
within the transform’s frame of reference. Setting the rotation
property of an object’s world relative transform using
getWorldTransform().rotation defines the object’s rotation relative
to the world origin. Setting the rotation property of an object’s
parent relative transform using transform.rotation defines the
object’s rotation relative to its parent node.
If you wish to modify the orientation of a transform it is recommended that
you use the rotate and prerotate methods instead of
setting this property.
Example
This statement sets the parent-relative rotation of the first camera in the
member to vector(0,0,0) :
member("Space").camera[1].transform.rotation = vector(0, 0, 0)
This example displays the parent-relative rotation of the model named Moon,
then it adjusts the model’s orientation using the rotate command, and finally it
displays the resulting world-relative rotation of the model:
put member("SolarSys").model("Moon").transform.rotation
-- vector( 0.0000, 0.0000, 45.0000)
member("SolarSys").model("Moon").rotate(15,15,15)
put member("SolarSys").model("Moon").getWorldTransform().rotation
--vector( 51.3810, 16.5191, 65.8771
rotation (engraver shader)
Usage
member(whichCastmember ).shader(whichShader ).rotation
member(whichCastmember ).model(whichModel ).shader.rotation
member(whichCastmember ).model(whichModel ).shaderList[index ].rotation
Description
3D shader engraver property; allows you to get or set an angle in degrees (as
a floating-point number) that describes a 2D rotational offset for engraved
lines. The default value for this property is 0.0.
Example
This statement rotates the lines used to draw the engraver shader for the
model gbCyl3 by 1°:
member("scene").model("gbCyl3").shader.rotation = member("scene").model("gbCyl3").shader.rotation + 1
rotation (backdrop and overlay)
Usage
sprite(whichSprite ).camera.backdrop[backdropIndex ].rotation
member(whichCastmember ).camera( whichCamera ) .backdrop
[backdropIndex ].rotation
sprite(whichSprite ).camera.overlay[overlayIndex ].rotation
member(whichCastmember ).camera[cameraIndex ].overlay
[overlayIndex ].rotation
Description
3D property; allows you to get or set the rotation of the backdrop or overlay
toward the default camera. The default value of this property is 0.0.
Example
This statement rotates a backdrop 60° around its registration point:
sprite(4).camera.backdrop[1].rotation = 60.0
|