; MD2AnimTime Example ; ------------------- Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() light=CreateLight() RotateEntity light,45,45,0 ; Load the md2 model and apply its texture gargoyle=LoadMD2("media/Gargoyle/Gargoyle.md2") garg_tex=LoadTexture("media/Gargoyle/Gargoyle.bmp") EntityTexture gargoyle,garg_tex ; Face the gargoyle towards the camera PositionEntity gargoyle,0,-45,100 RotateEntity gargoyle,0,180,0 ; Loop the wing-flap frames 32-46 AnimateMD2 gargoyle,1,0.1,32,46 While Not KeyDown(1) UpdateWorld ; Arrow keys move the camera If KeyDown(200) Then MoveEntity camera,0,0,1 If KeyDown(208) Then MoveEntity camera,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,"Arrows: camera Esc: exit" ; MD2AnimTime reports the exact frame position, e.g. 33.5 means the ; model is morphing halfway between frames 33 and 34 Text 0,20,"MD2AnimTime(gargoyle) = "+MD2AnimTime(gargoyle) Flip Wend End