AnimateMD2.htm 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <html>
  2. <head>
  3. <title>Blitz3D Docs</title>
  4. <link rel=stylesheet href=../css/commands.css type=text/css>
  5. </head>
  6. <body>
  7. <h1>AnimateMD2 md2[,mode][,speed#][,first_frame][,last_frame][,transition#]</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. md2 - md2 handle <br />
  13. <br />
  14. mode (optional) - mode of animation <br />
  15. 0: stop animation <br />
  16. 1: loop animation (default) <br />
  17. 2: ping-pong animation <br />
  18. 3: one-shot animation <br />
  19. <br />
  20. speed# (optional) - speed of animation. Defaults to 1. <br />
  21. first_frame (optional) - first frame of animation. Defaults to 1. <br />
  22. last_frame# (optional) - last frame of animation. Defaults to last frame of all md2 animations. <br />
  23. transition# (optional) - smoothness of transition between last frame shown of previous animation and first frame of next animation. Defaults to 0.
  24. </td>
  25. </tr>
  26. </table>
  27. <h1>Description</h1>
  28. <table>
  29. <tr>
  30. <td>
  31. Animates an md2 entity. <br />
  32. <br />
  33. The md2 will actually move from one frame to the next when UpdateWorld is called.
  34. </td>
  35. </tr>
  36. </table>
  37. <h1><a href=../3d_examples/AnimateMD2.bb>Example</a></h1>
  38. <table>
  39. <tr>
  40. <td>
  41. ; AnimateMD2 Example <br />
  42. ; ------------------ <br />
  43. <br />
  44. Graphics3D 640,480 <br />
  45. SetBuffer BackBuffer() <br />
  46. <br />
  47. camera=CreateCamera() <br />
  48. <br />
  49. light=CreateLight() <br />
  50. RotateEntity light,90,0,0 <br />
  51. <br />
  52. ; Load md2 <br />
  53. gargoyle=LoadMD2( "media/gargoyle/gargoyle.md2" ) <br />
  54. <br />
  55. ; Load md2 texture <br />
  56. garg_tex=LoadTexture( "media/gargoyle/gargoyle.bmp" ) <br />
  57. <br />
  58. ; Apply md2 texture to md2 <br />
  59. EntityTexture gargoyle,garg_tex <br />
  60. <br />
  61. ; Animate md2 <br />
  62. AnimateMD2 gargoyle,1,0.1,32,46 <br />
  63. <br />
  64. PositionEntity gargoyle,0,-45,100 <br />
  65. RotateEntity gargoyle,0,180,0 <br />
  66. <br />
  67. While Not KeyDown( 1 ) <br />
  68. UpdateWorld <br />
  69. RenderWorld <br />
  70. Flip <br />
  71. Wend <br />
  72. <br />
  73. End
  74. </td>
  75. </tr>
  76. </table>
  77. <br>
  78. <a target=_top href=../index.htm>Index</a><br>
  79. <br>
  80. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=AnimateMD2&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  81. </html>