drawObjects()
Purpose
Draw all 3D objects
Description
Draws all of the current 3D objects to the frameBuffer in their current positions using the current camera position and lighting
Syntax
drawObjects( )
Arguments
Example
obj = placeObject( cube, { 0, 0, 0 }, { 2, 2, 2 } )
setObjectMaterial( obj, red, 1, 1 )
setCamera( { 5, 5, 10 }, { 0, 0, 0 } )
light = pointLight( { 0, 4, 2 }, white, 100 )
x = 0
loop
clear()
c = controls( 0 )
setLightPos( light, { x, 4, 2 } )
if c.left then
x = x - 0.2
endIf
if c.right then
x = x + 0.2
endIf
rotateObject( obj, { 1, 1, 1 }, 0.5 )
drawObjects()
printAt( 0, 0, "Use left and right directional buttons to move light source: ", x )
update()
repeat
Associated Commands
placeObject(), pointLight(), rotateObject(), setCamera(), setObjectMaterial()