rotateObject()
Purpose
Rotate a 3D object
Description
Rotate a 3D object through the specified axes and by the specified amount
Syntax
rotateObject( handle, axes, amount )
Arguments
handle The handle of the placed 3D object
axes vector which describes the axes of rotation { x, y, z } e.g. { 1, 0, 0 } rotates in the x axes only
amount Amount to rotate the object in degrees( 0 to 360)
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 arrows to move light source: ",x )
update()
repeat
Associated Commands
drawObjects(), loadModel(), objectPointAt(), placeObject(), removeObject(), setObjectMaterial(), setObjectPos(), setObjectScale()