Files
BlitzNext/_release/help/commands/3d_commands/MD2Animating.htm
T
2014-12-08 12:43:20 +13:00

77 lines
1.7 KiB
HTML

<html>
<head>
<title>Blitz3D Docs</title>
<link rel=stylesheet href=../css/commands.css type=text/css>
</head>
<body>
<h1>MD2Animating ( md2 )</h1>
<h1>Parameters</h1>
<table>
<tr>
<td>
md2 - md2 handle
</td>
</tr>
</table>
<h1>Description</h1>
<table>
<tr>
<td>
Returns 1 (True) if md2 is currently animating, 0 (False) if not.
</td>
</tr>
</table>
<h1><a href=../3d_examples/MD2Animating.bb>Example</a></h1>
<table>
<tr>
<td>
; MD2Animating 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 />
<br />
; Toggle animation stop/start when spacebar pressed
<br />
If KeyHit( 57 )=True start=1-start : AnimateMD2 gargoyle,start,0.1,32,46
<br />
<br />
UpdateWorld
<br />
RenderWorld
<br />
<br />
Text 0,0,"Press spacebar to stop/start md2 animation"
<br />
<br />
; Output current md2 animation status to screen
<br />
Text 0,20,"MD2Animating: "+MD2Animating( gargoyle )
<br />
<br />
Flip
<br />
<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=MD2Animating&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
</html>