How do i implement linear interpolation

Started by
10 comments, last by cr88192 10 years, 11 months ago

[...] any idea where the scaling information is

It's also in the 3x3 matrix. That matrix can be any linear mapping, which besides rotations also allow for things like scalings, taking mirror images and shearing mappings. But I prefer to force them to be rotations for most situations.
Advertisement
FWIW: one trick I had used before for interpolating matrices directly was to identify a common rotation axis, and then rotate all of the vectors in the matrix (as points) along this axis.

typically this axis was found/approximated by finding which unit axis changed the least during the movement, interpolating this axis (by treating it as an arc along the plane formed by its 2 positions and the origin), and then using this interpolated axis to rotate the matrix by (trying to rotate the source-matrix into the destination matrix).

(there may be better ways to calculate this axis though).

the math gets hairy, and there may be a better and more accurate ways to do this, but in my uses it seemed to work ok (much better than linearly interpolating them at least...).

(I can imaging a few ugly hacks though to possibly boost accuracy, but decided against elaborating on them).

This topic is closed to new replies.

Advertisement