LoadAnimMesh.bb 751 B

12345678910111213141516171819202122232425262728293031
  1. ; LoadAnimMesh Example
  2. ; --------------------
  3. ; In this example we will demonstrate the use of the LoadAnimMesh command.
  4. ; Quite simply, we will load an anim mesh from file, animate it, and then view it.
  5. Graphics3D 640,480
  6. SetBuffer BackBuffer()
  7. camera=CreateCamera()
  8. PositionEntity camera,0,20,-100 ; position camera so that robot will be in view when loaded
  9. light=CreateLight()
  10. RotateEntity light,90,0,0
  11. ; Load anim mesh
  12. robot=LoadAnimMesh("media/makbot/mak_robotic.3ds")
  13. ; Animate mesh - this will begin an animation sequence which is updated when UpdateWorld is called
  14. Animate robot,2
  15. While Not KeyDown(1)
  16. UpdateWorld ; Update anim - without this our anim mesh will freeze
  17. RenderWorld ; Render everything
  18. Flip ; Show everything
  19. Wend
  20. End