Skip to content

Update matrix_decompose to include shear and non-isotropic scaling #32

@FirefoxMetzger

Description

@FirefoxMetzger

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions