| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <html>
- <head>
- <title>Blitz3D Docs</title>
- <link rel=stylesheet href=../css/commands.css type=text/css>
- </head>
- <body>
- <h1>LoadMD2 ( md2_file$[,parent] )</h1>
- <h1>Parameters</h1>
- <table>
- <tr>
- <td>
- md2_file$ - filename of md2
<br />
- parent (optional) - parent entity of md2
- </td>
- </tr>
- </table>
- <h1>Description</h1>
- <table>
- <tr>
- <td>
- Loads an md2 entity and returns its handle.
<br />
-
<br />
- An md2's texture has to be loaded and applied to the md2 separately, otherwise the md2 will appear untextured.
<br />
-
<br />
- Md2's have their own set of animation commands, and will not work with normal animation commands.
<br />
-
<br />
- 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 />
-
<br />
- 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.
- </td>
- </tr>
- </table>
- <h1><a href=../3d_examples/LoadMD2.bb>Example</a></h1>
- <table>
- <tr>
- <td>
- ; LoadMD2 Example
<br />
- ; ---------------
<br />
-
<br />
- Graphics3D 640,480
<br />
- SetBuffer BackBuffer()
<br />
-
<br />
- camera=CreateCamera()
<br />
-
<br />
- light=CreateLight()
<br />
- RotateEntity light,90,0,0
<br />
-
<br />
- ; Load md2
<br />
- gargoyle=LoadMD2( "media/gargoyle/gargoyle.md2" )
<br />
-
<br />
- ; Load md2 texture
<br />
- garg_tex=LoadTexture( "media/gargoyle/gargoyle.bmp" )
<br />
-
<br />
- ; Apply md2 texture to md2
<br />
- EntityTexture gargoyle,garg_tex
<br />
-
<br />
- PositionEntity gargoyle,0,-45,100
<br />
- RotateEntity gargoyle,0,180,0
<br />
-
<br />
- While Not KeyDown( 1 )
<br />
- RenderWorld
<br />
- Flip
<br />
- Wend
<br />
-
<br />
- End
- </td>
- </tr>
- </table>
- <br>
- <a target=_top href=../index.htm>Index</a><br>
- <br>
- 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>
- </html>
|