Advertisement

Interpolating Animation Frames

Started by January 25, 2001 01:08 PM
3 comments, last by Thrump 24 years ago
Is it possible to interpolate animation frames at run-time? For example, I want to make 25 frames run over the time of 30 frames, but it''s not known until the game is being played. How involved is this? A weekend? 1 week? 1 month? I may have a few things doing this on screen at a time. Is this possible? Thanks.
Wouldn''t this happen automagically if you use delta-times in the animation calculation? Something like (hopeless pseudo-code):
  dest = destination framecurr = current frame but moved dt timesMoveVertices(curr, dest, dt){  for all vertices do  {    dist = dest.vertex - curr.vertex;    curr.vertex += dist * dt;  }}  

Advertisement
Here''s the equation...

interpolated_point = point_frame_end * dt + point_frame_start * ( 1.0f - dt );

(where dt is the time ''location'' between the two frames, dt>=0.0f, dt<1.0f)

point_frame_start is the location of the point in the current frame
point_frame_end is the location of the point in the destination frame

What I do is that i set dt += speed * Delta_Time where Delta_Time is the time that''s passed since the last frame. Then when dt >= 1.0 i change to the next frame and set dt = 0.

I did this in about 2 days, but I already had an animation system set up without interpolation.

Digital Radiation
Thanks for the tips. It gave me some food for thought. I can''t do this right now, as I know now that something that''s not done yet has to be done first. So, I''ll get back to you with my results at a later date.
To my understanding, this can be done with DX8 rather easily. as in 1 hour. all you have to do is load the frames mesh''s into different vertex buffers, and then use SetStream to put them in different streams, and then dx8 has built in support for interpolating them.

This topic is closed to new replies.

Advertisement