3D_POINT_OBJECT

3D_POINT_OBJECT N,P

POINTS THE 3D OBJECT NUMBER N TO THE 3D OBJECT NUMBER P

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

ACTION

The command 3D_POINT_OBJECT N,P points the 3D object number N to the 3D object number P: the 3D object number N turns towards the 3D object number P and its pointing direction is the direction to the 3D object number P.

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_POINT_OBJECT N,P

  • 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.
  • P = 3D object number (integer or real). Must be greater than 0 and less than or equal to the allowed maximum number of 3D objects.

USE

  • The command 3D_POINT_OBJECT is used with 3D_MOVE to drive a 3D object to another 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 number P is not a correct expression.
  • If number P exceeds the allowed maximum number of 3D objects.
  • If number P is less than or equal to 0.
  • If the 3D object number P does not exist.
  • If P=N.

EXAMPLE

rem create a 3D world

scene3d 1

rem create a cube

3d_cube 1,1

rem create a cylinder

3d_cylinder 2,1,0.5,0.5

rem position the cylinder

3d_x_position 2,2

rem point the cube to the cylinder

3d_point_object 1,2

rem the cube get closer the cylinder

3d_move 1,1

SEE ALSO

3D_MOVE

3D_X_ROTATE

3D_Y_ROTATE

3D_Z_ROTATE