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

82 lines
2.1 KiB
HTML

<html>
<head>
<title>Blitz3D Docs</title>
<link rel=stylesheet href=../css/commands.css type=text/css>
</head>
<body>
<h1>AnimateMD2 md2[,mode][,speed#][,first_frame][,last_frame][,transition#]</h1>
<h1>Parameters</h1>
<table>
<tr>
<td>
md2 - md2 handle
<br />
<br />
mode (optional) - mode of animation
<br />
0: stop animation
<br />
1: loop animation (default)
<br />
2: ping-pong animation
<br />
3: one-shot animation
<br />
<br />
speed# (optional) - speed of animation. Defaults to 1.
<br />
first_frame (optional) - first frame of animation. Defaults to 1.
<br />
last_frame# (optional) - last frame of animation. Defaults to last frame of all md2 animations.
<br />
transition# (optional) - smoothness of transition between last frame shown of previous animation and first frame of next animation. Defaults to 0.
</td>
</tr>
</table>
<h1>Description</h1>
<table>
<tr>
<td>
Animates an md2 entity.
<br />
<br />
The md2 will actually move from one frame to the next when UpdateWorld is called.
</td>
</tr>
</table>
<h1><a href=../3d_examples/AnimateMD2.bb>Example</a></h1>
<table>
<tr>
<td>
; AnimateMD2 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 />
; Animate md2
<br />
AnimateMD2 gargoyle,1,0.1,32,46
<br />
<br />
PositionEntity gargoyle,0,-45,100
<br />
RotateEntity gargoyle,0,180,0
<br />
<br />
While Not KeyDown( 1 )
<br />
UpdateWorld
<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=AnimateMD2&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
</html>