loadModel()
Purpose
Load a 3D model ready for display
Description
Load a 3D model that can then be placed in the screen buffer using placeobject and displayed using drawobjects
Syntax
handle = loadModel( filename )
Arguments
handle variable which stores the desired 3D model file
filename relative path of the 3D model to load
Example
cb = loadModel( "Kat Deak/Colin" )
pointLight( { 0.5, 1.3, 2 }, white, 4 )
setAmbientLight( { 0.5, 0.5, 0.5 } )
colin = placeObject( cb, { 0, 0, 0 }, { 1, 1, 1 } )
setCamera( { 0, 10, 10 }, { 0, 5, 0 } )
animID = 6 // walking
animLength = animationLength( colin, animID )
animFrame = 0
loop
clear()
animframe = animframe + 1/60
if animframe >= animlength then
animframe = 0
endIf
updateAnimation( colin, animID, animframe )
drawObjects()
printAt( 0, 0, "length: ", animlength, " frame: ", animframe )
update()
repeat
Associated Commands
drawObjects(), placeObject(), removeObject(), rotateObject(), setObjectMaterial()