3D_CYLINDER

3D_CYLINDER N,H,TR,LR

CREATES A CYLINDER WITH HEIGHT, TOP AND LOW RADIUS, AND GIVES IT THE NUMBER N AS REFERENCE

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

ACTION

The command 3D_CYLINDER creates a cylinder with specified values for height H, radius of the top side TR, radius of the low side LR and gives it a number N.

The number is used to designate the cylinder.

The center of the cylinder is placed in (0,0,0) : the center of the 3D world (SCENE3D).

The color of the cylinder is gray at creation and can be modified by the command 3D_COLOR.

The cylinder can be moved, rotated, scaled, colored, textured, deleted, hidden, showed.. with the appropriated commands.

Remark 1: if the radius of the top side TR and the radius of the low side LR are not equal, we have a truncated cone.

Remark 2: by default, the cylinder is created in the first created SCENE3D, but another SCENE3D can be used. For that, create a new SCENE3D, and send it all the commands by 3D_TARGET_IS before creating the cylinder.

SYNTAX: 3D_CYLINDER N,H,TR,LR

  • 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.
  • H = height value (integer or real). Must be greater than 0.
  • TR = radius of the top side value (integer or real). Must be greater than 0.
  • LR = radius of the low side value (integer or real). Must be greater than 0.

USE

  • The command 3D_CYLINDER is used to create a cylinder in a SCENE3D.

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 number N is already used for another 3D object.
  • If height H or top radius TR or low radius LR is not a correct expression.
  • If height H or top radius TR) or low radius LR is less than or equal to 0.
  • If no SCENE3D is created.

EXAMPLE

rem create a 3D world

scene3d 1

rem create a cylinder number 1

3d_cylinder 1,1.5,0.8,1.2

rem move the camera

cam_y_position 2

SEE ALSO

3D_COLOR

3D_DELETE

3D_DELETE_ALL

3D_LOAD_TEXTURE

3D_HIDE

3D_SHOW

3D_TARGET_IS

3D_X_POSITION

3D_Y_POSITION

3D_Z_POSITION

3D_X_ROTATE

3D_Y_ROTATE

3D_Z_ROTATE

3D_X_SCALE

3D_Y_SCALE

3D_Z_SCALE