; CameraClsColor Example ; ---------------------- Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,1,-5 light=CreateLight() RotateEntity light,45,45,0 ; A spinning pickup coin floats in front of the camera coin=CreateCylinder() ScaleEntity coin,1,0.1,1 PositionEntity coin,0,1,0 EntityColor coin,255,200,0 red=0 green=0 blue=64 While Not KeyDown(1) ; Hold keys 1/2, 3/4, 5/6 to lower and raise the red, green and blue values If KeyDown(2) And red>0 Then red=red-1 If KeyDown(3) And red<255 Then red=red+1 If KeyDown(4) And green>0 Then green=green-1 If KeyDown(5) And green<255 Then green=green+1 If KeyDown(6) And blue>0 Then blue=blue-1 If KeyDown(7) And blue<255 Then blue=blue+1 ; Set the colour the camera clears the screen to each frame CameraClsColor camera,red,green,blue TurnEntity coin,0,2,0 ; Arrow keys move the camera If KeyDown(200) Then MoveEntity camera,0,0,0.1 If KeyDown(208) Then MoveEntity camera,0,0,-0.1 If KeyDown(203) Then TurnEntity camera,0,1,0 If KeyDown(205) Then TurnEntity camera,0,-1,0 RenderWorld Text 0,0,"Keys 1-6: change red/green/blue Arrow keys: move camera Esc: exit" Text 0,20,"CameraClsColor camera,"+red+","+green+","+blue Flip Wend End