3D_ROTATE

3D_ROTATE N,X,Y,Z

ROTATES THE 3D OBJECT NUMBER N AROUND ITS AXES

  • Type: Command
  • Parameters: 4
  • Group: 3D Objects

ACTION

The command 3D_ROTATE N,X,Y,Z turns the 3D object designated by its number N, of an angle of X degrees around its own X axis, then of an angle of Y degrees around its own Y axis, then of an angle of Z degrees around its own Z axis,in relation to its initial position.

The own X axis of the 3D object is the axis of object which was parallel to the 3D world X axis when the 3D object was created.

The own Y axis of the 3D object is the axis of object which was parallel to the 3D world Y axis when the 3D object was created.

The own Z axis of the 3D object is the axis of object which was parallel to the 3D world Z axis when the 3D object was created.

The pointing direction of the 3D object number N is changed.

Recall: at creation, the pointing direction of a 3D object is the vector (0,0,1). This pointing direction is changed by the rotation commands on the 3D object: 3D_X_ROTATE, 3D_Y_ROTATE, 3D_Z_ROTATE and by the pointing at a 3D object command: 3D_POINT_OBJECT.

SYNTAX: 3D_ROTATE N,X,Y,Z

  • N = 3D object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of 3D objects.
  • X = rotation angle value (integer or real) expressed in degrees.
  • Y = rotation angle value (integer or real) expressed in degrees.
  • Z = rotation angle value (integer or real) expressed in degrees.

USE

  • The command 3D_ROTATE is used to rotate a 3D object around its own axes.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of 3D objects.
  • If number N is not greater than 0.
  • If 3D object number N does not exist.
  • If angle X is not a correct expression.
  • If angle Y is not a correct expression.
  • If angle Z is not a correct expression.

EXAMPLE

rem create a 3D world

scene3d 1

rem resize the 3D world

width 1,300:height 1,300

rem place the camera

cam_position 5,10,10

rem create a cube

3d_cube 1,1.5

rem wait for 1 second

wait 1000

rem rotate it of 45 degrees around its 3 own axes

3d_rotate 1,45,45,45

SEE ALSO

3D_X_ROTATE

3D_Y_ROTATE

3D_Z_ROTATE