gl-matrix icon indicating copy to clipboard operation
gl-matrix copied to clipboard

Mat4 get rotation does not give a valid quaternion when mat4 is scaled (also quat2.fromMat4 issue)

Open signorpipo opened this issue 3 years ago • 0 comments

If u set the mat4 with a quaternion rotation, scale the mat4 and then call getRotation, u won't get the initial rotation, and normalize that result won't get it either. U need to scale it back to 1 and call getRotation if u want the rotation u put in.

This also means quat2.fromMat4 does not work if the matrix4 has a scale. This at least in the environment I work with, where the scale is not saved into the quat2 transform.

signorpipo avatar Jul 18 '21 08:07 signorpipo