How do I perform interpolation between two matrices?

Started by
4 comments, last by initial_y 21 years, 9 months ago
that''s it
汇编语言不会编
Advertisement
I think you can''t directly: to interpolate, use quaternions, that''s one of their advantages...
Interpolation between two matrices -- I''m assuming for transformations -- should be relatively straight forward and similar to any other form of linear interpolation.

Assume you want an object at pointA at time 0 and then to move that object to pointB over a 5 second period. (''A'' will be the inital matrix and ''B'' will be the final matrix for the object).

Now, you know the change in time (timeB - timeA or 5sec in this case). Next figure out the difference between matrix B and matrix A (matrixB - matrixA) and divide it by the change in time. You now have a matrix that gives you the transformation in one second. Call it matrix C.

To calculate the final interpolated matrix you will first need to know how much time has passed. Multiply matrix C by the time that has passed and add it to matrix A, your original starting matrix. That is all there is to it. I hope my instructions are clear.

Two things of note. If you are making an application, use a unit smaller than seconds (ie milliseconds). This will smooth out the interpolation. Also, this is only a discription of linear interpolation. There are other options but this is the simplest.

Chris Z.
Chris Z. GPU FX
ZeroEffects method only works for matrices which are fairly close to each other to begin with, think abot what would happen if you had to interpolate a 180 degree rotation...
I assume most of the transformations are just rotations, the key property of rotation matrices is that they have determinant 1 and all rows and columns are (a) linearly independent and (b) mutually orthonormal (i.e. perpendicular and normalised).
The linear interpolation method doesn''t preserve the above 2 identities.

I would recommend quaternions for rotation interpolation too, they are equivalent to axis-angle representations of rotations.
the mythod in my mind is extract angle and rotation axis between the two matrices first.then extract distance between them.final calculate the intermediate matrix in time t between them.

is it right?
汇编语言不会编
It takes two rotations to make two matrices equal. So a single rotation matrix for time t wouldn't work. Check out my answer in your post in the Game Programming forum

[edited by - Waverider on August 8, 2002 11:45:29 AM]
It's not what you're taught, it's what you learn.

This topic is closed to new replies.

Advertisement