Archived

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

Matrix Interpolation for Animation?

This topic is 5889 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Howdy, Would anyone know any good tutorials (or just a quick answer) about matrix interpolation? I am refering to creating a matrix based upon two key-frame matrices and a time. This will usually happen when you have two key frames for an animation, and only have a final concated matrix for each frame. The translation part is easy to pull out of the matrix, but everything else seems a little tricky. Any help or pointers to any info. would be great! Thanks!

Share this post


Link to post
Share on other sites
Using D3DX, matrix interpolation is actually quite fast and easy:

// TotalTime = length between 1st and 2nd matrices
// InterpolateTime = time from 0.0 to 1.0
D3DXMATRIX Matrix1, Matrix2;
float TotalTime, InterpolateTime;
D3DXMATRIX Result;

Result = Matrix1 + ((Matrix2 - Matrix1) / TotalTime * (InterpolateTime * TotalTime));

Jim Adams

Share this post


Link to post
Share on other sites