excessive/cpml

Why matrix multiply order was reversed?

semyon422 opened this issue · 3 comments

By multiplying A by B in mat4.mul(out, a, b), you are actually multiplying B by A. You say that "composition a*b means "apply b, then a", but there is no such thing as "apply". Matrix multiplication is strictly defined in mathematics, and you came up with something of your own here.

a story long lost in the depths of history that has something or other to do with transposed (row vs col major memory ordering) matrices, matching results with other libraries, and nothing whatsoever to do with the mathematics.

Would you find the text better if it said "for affine transform matrixes means apply b, then a"?

Thanks for the answer, now I am studying this question in more detail. How are matrices stored in cpml? mat[2] is A_12 (1 row, 2 column) or A_21 (2 row, 1 column)?