rematrix icon indicating copy to clipboard operation
rematrix copied to clipboard

Linearly interpolating between two matrixes

Open MarcGuiselin opened this issue 3 years ago • 2 comments

Animating transforms requires computing intermediary states at arbitrary intervals between two transforms.

I propose the addition of a interpolate(from, to, progress)

MarcGuiselin avatar Apr 21 '22 22:04 MarcGuiselin

There are several ways to linearly interpolate between two transformation matrixes. However, in order to match the behavior of browsers (and produce no weird deformations), the matrix must be decomposed into scale, skew, translation, perspective and quaternion rotation. This is called polar decomposition. Then we can linearly interpolate between those and compose a new matrix... no small feat.

See:

MarcGuiselin avatar Apr 21 '22 22:04 MarcGuiselin

This sounds freaking awesome @MarcGuiselin, I appreciate the feature request and resources.

jlmakes avatar Feb 08 '23 10:02 jlmakes