SET THE COLOR OF THE 3D OBJECT NUMBER N
ACTION
The command 3D_COLOR N,R,G,B colors the 3D object designated by its number, with the color resulting of the addition of the 3 specified primary components: red (R), green (G) and blue (B).
The intensity of each primary component can vary from 0 to 255. (0 = no color, 255 = full intensity)
Remark: when all the 3 primary components are 0, the result color is black (no color), when all the 3 primary components are 255, the result color is white (addition of the 3 primary colors at maximum intensity).
Recall:
- yellow color (red + green) when B = 0
- gray color when R=G=B
- violet color (red + blue) when G = 0
- black color when R=0, G=0, B=0
- white color when R=255, G=255, B=255
SYNTAX:
3D_COLOR N,R,G,B
USE ERROR 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 object number 1) with side length of 1.5
3d_cube 1,1.5
rem wait for 1 second
wait 1000
rem give a yellow color to the cube (yellow = red + green)
3d_color 1,200,200,0
3D_COLOR
3D_COLOR N,R,G,B
SEE ALSO
-