3D_LOAD_TEXTURE

3D_LOAD_TEXTURE N,F

APPLIES TO THE 3D OBJECT NUMBER N THE TEXTURE IN THE FILE F

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

ACTION

The command 3D_LOAD_TEXTURE N,F assigns a texture to an existing 3D object.

The texture is in the file F.

The file must be in BMP format (Bitmap).

SYNTAX: 3D_LOAD_TEXTURE N,F

  • 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.
  • F = (absolute or relative) name of the file containing the texture

USE

  • The command is used to give a texture to 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 not greater than 0.
  • If 3D object number N does not exist.
  • If number N corresponds to a LINE (3D_LINE).
  • If F is not a correct string expression.
  • If file F does not exist.

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 sphere

3d_sphere 1,2

rem wait for 1 second

wait 1000

rem give it a texture

3d_load_texture 1,"earth.bmp"

SEE ALSO

3D_LOAD_OBJECT