Registered Member
|
Hello,
What is the fastest way to interpolate Affine transforms (by linearly interpolating the position, rotation and scale independently). Currently we use the following code:
Whenever possible we store the decomposed values and only compose the interpolated Affine matrix. |
Moderator
|
Sounds good.
The lerp_decompose step is by far the most expensive one, so it is very important to avoid it as much as you can by storing and using triplets of Quaternion, Scale, and Translation. |
Registered Member
|
Would it be more efficient to store the 3x3 rotation matrices instead of the quaternions because you'll need those in the end in the affine transform?
Or will the slerp function become much more complicated then? |
Moderator
|
slep cannot be easily done a 3x3 rotation matrix. Quaternion is really the best representation for that.
btw, for the affine to quaternion-scale-translation decomposition, if you know that the affine transformation has no shear, then you can simply do: scale = aff.linear().colwise().norm(); a = aff.linear() * scale.asDiagonal().inverse(); which is reasonably fast compared to the general case. |
Registered Member
|
Ah, yes. That makes sense.
Thanks for helping me out. |
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]