3D_MOVE

3D_MOVE N,D

MOVES THE 3D OBJECT NUMBER N BY THE DISTANCE D IN ITS POINTING DIRECTION

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

ACTION

The command 3D_MOVE N,D moves the distance D forward or back the 3D object number N in its pointing direction.

The 3D object moves forward if D is positive.

The 3D object moves back if D is negative.

Recall: at creation, the pointing direction of a 3D object is the vector (0,0,1). The 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_MOVE N,D

  • 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.
  • D = distance value.

USE

  • The command 3D_MOVE is used to move a 3D object.

ERROR

  • If number N is not a correct expression.
  • If number N exceeds the allowed maximum number of 3D objects.
  • If number N is less than or equal to 0.
  • If the 3D object number N does not exist.
  • If D is not a correct expression.

EXAMPLE

rem create a 3D world

scene3d 1

rem create a cube

3d_cube 1,1

rem move it forward

3d_move 1,5

rem put it at its place

3d_move 1,-5

SEE ALSO

3D_POINT_OBJECT

3D_X_ROTATE

3D_Y_ROTATE

3D_Z_ROTATE