Tuesday, December 30, 2008

SHADOWS=TRUE






Strict

Import max3d.m3d

GLGraphics 800,600,0,60,GRAPHICS_BACKBUFFER

m3dInit "SHADOWS=TRUE"

m3dSetClearColor 0,.1,.4

Local yellow=m3dCreateMaterial()
m3dSetMaterialColor yellow,"DiffuseColor",1,1,0

Local entity=m3dCreateBox( yellow,1,1,1,2,0 )
m3dMoveEntity entity,0,2,0

Local light=m3dCreatePointLight()
m3dMoveEntity light,6,10,-10

m3dSetAmbientColor .5,.5,.5

Local green=m3dCreateMaterial()
m3dSetMaterialColor green,"DiffuseColor",0,1,0

Local ground=m3dCreateBox( green,100,.1,100,2,0 )

Local camera=m3dCreateCamera()
m3dMoveEntity camera,0,2,-2

While Not KeyHit( KEY_ESCAPE )
m3dTurnEntity entity,1,2,3
m3dRenderWorld
Flip
Wend

No comments: