Математика

Физика

Химия

Биология

Техника и    технологии

 

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)

                        

                        
pointAt
                        

                        
                        

                        
  • 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)

 

Hosted by uCoz