Skip to content

Wrong order of operations in utils/rotation unit test #26

@heysokam

Description

@heysokam

const mat = mul(mul(rotate_origin, scaling(3, 4, 5)), translation(6, 7, 8));

I'm trying to unconfuse myself on exactly which order I should apply matrices to a vector using zmath functions.
While searching for an answer, I stumbled upon this line of code.

If convention is that, in order to achieve correct transformations, objects should be transformed in this order:

First: Scale -> then Rotate -> Last: Translate

then why is this line seemingly using a different order of operations?

I know the difference might be irrelevant for the test, or the test might be checking for different numbers where this order does not even make a difference.

But if tests are the only source of documentation/truth for this library...
shouldn't they operate in the expected order, such as to not confuse potential adopters of the code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions