As we allow non-isotropic scaling in pygfx and pylinalg, it would be good if our matrix decomposition routine could support this as well.
Currently, we extract a uniform scale via the matrix determinant, and we also don't account for shear that may be introduced as the result of chaining two matrices with non-trivial rotation and non-isotropic scale.
From an implementation side, I found an interesting document that walks through some of the math behind decomposing such a transform. It uses our convention (all parameters in source/parent space, our desired order of applying matrices), so it is mostly just implementing those functions in pylinalg. Here is a link to the document: https://caff.de/posts/4X4-matrix-decomposition/decomposition.pdf
As we allow non-isotropic scaling in pygfx and pylinalg, it would be good if our matrix decomposition routine could support this as well.
Currently, we extract a uniform scale via the matrix determinant, and we also don't account for shear that may be introduced as the result of chaining two matrices with non-trivial rotation and non-isotropic scale.
From an implementation side, I found an interesting document that walks through some of the math behind decomposing such a transform. It uses our convention (all parameters in source/parent space, our desired order of applying matrices), so it is mostly just implementing those functions in pylinalg. Here is a link to the document: https://caff.de/posts/4X4-matrix-decomposition/decomposition.pdf