Matrix Interpolation for Animation?
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!
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
// 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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement