• ### Announcements

#### Archived

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

# Interpolating Animation Frames

## Recommended Posts

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.

##### Share on other sites
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; }}

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites
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.

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627662
• Total Posts
2978506

• 9
• 10
• 12
• 22
• 13