LoadMD2.htm 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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>LoadMD2 ( md2_file$[,parent] )</h1>
  8. <h1>Parameters</h1>
  9. <table>
  10. <tr>
  11. <td>
  12. md2_file$ - filename of md2 <br />
  13. parent (optional) - parent entity of md2
  14. </td>
  15. </tr>
  16. </table>
  17. <h1>Description</h1>
  18. <table>
  19. <tr>
  20. <td>
  21. Loads an md2 entity and returns its handle. <br />
  22. <br />
  23. An md2's texture has to be loaded and applied to the md2 separately, otherwise the md2 will appear untextured. <br />
  24. <br />
  25. Md2's have their own set of animation commands, and will not work with normal animation commands. <br />
  26. <br />
  27. The optional parent parameter allows you to specify a parent entity for the md2 so that when the parent is moved the child md2 will move with it. However, this relationship is one way; applying movement commands to the child will not affect the parent. <br />
  28. <br />
  29. Specifying a parent entity will still result in the md2 being created at position 0,0,0 rather than at the parent entity's position.
  30. </td>
  31. </tr>
  32. </table>
  33. <h1><a href=../3d_examples/LoadMD2.bb>Example</a></h1>
  34. <table>
  35. <tr>
  36. <td>
  37. ; LoadMD2 Example <br />
  38. ; --------------- <br />
  39. <br />
  40. Graphics3D 640,480 <br />
  41. SetBuffer BackBuffer() <br />
  42. <br />
  43. camera=CreateCamera() <br />
  44. <br />
  45. light=CreateLight() <br />
  46. RotateEntity light,90,0,0 <br />
  47. <br />
  48. ; Load md2 <br />
  49. gargoyle=LoadMD2( "media/gargoyle/gargoyle.md2" ) <br />
  50. <br />
  51. ; Load md2 texture <br />
  52. garg_tex=LoadTexture( "media/gargoyle/gargoyle.bmp" ) <br />
  53. <br />
  54. ; Apply md2 texture to md2 <br />
  55. EntityTexture gargoyle,garg_tex <br />
  56. <br />
  57. PositionEntity gargoyle,0,-45,100 <br />
  58. RotateEntity gargoyle,0,180,0 <br />
  59. <br />
  60. While Not KeyDown( 1 ) <br />
  61. RenderWorld <br />
  62. Flip <br />
  63. Wend <br />
  64. <br />
  65. End
  66. </td>
  67. </tr>
  68. </table>
  69. <br>
  70. <a target=_top href=../index.htm>Index</a><br>
  71. <br>
  72. Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=LoadMD2&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
  73. </html>