Archived

This topic is now archived and is closed to further replies.

nlo

3D model interpolation How-to

Recommended Posts

Anyone know how to write the interpolate animation function between 3D model keyframes in DirectX ? I wanna use Quake 2 ".md2" model to create games, i can load model & play the key animations, but they just not that smooth... is there some place has tutorial about that ? thanks for help.

Share this post


Link to post
Share on other sites
Pretty straightforward - if you have 2 positions X1 and X2 and a total interpolation time T, then any interim position at time t is:

X1 + (t / T)(X2 - X1)

at t = 0, the position is X1
at t = T, the position is X1 + X2 - X1 = X2

You can do that for every vertex, or optimally for every bone (I can''t remember the md2 spec off hand).

Look at some of the DX8 animation samples...

Share this post


Link to post
Share on other sites