if I inline this code I end up with this order: p_ = p * M1 * M2, which would imply that p is first multiplied by M1 and then M2, but that's not what happens. The result M1 * M2 * p, i.e. it's multiplied by M2 and then by M1.
Wouldn't this order vec3.transformMat4(p_, M_, p); be less confusing? Is it just an oversight or am I missing something?
For example, writing this in CoreGraphics would look like this:
p_ = p.applying(M1.concatenating(M2))
and mathematically equivalent to p_ = p * M1 * M2, i.e. the consistent order, although a bit unconventional use of row-vectors for someone coming from a math background, but at least they are super consistent about that when it comes to the order of arguments in API or any explanations in the documentation.
I'm confused about the order of arguments, as it doesn't follow mathematical logic. This code specifically:
if I inline this code I end up with this order:
p_ = p * M1 * M2
, which would imply thatp
is first multiplied byM1
and thenM2
, but that's not what happens. The resultM1 * M2 * p
, i.e. it's multiplied byM2
and then byM1
.Wouldn't this order
vec3.transformMat4(p_, M_, p);
be less confusing? Is it just an oversight or am I missing something?For example, writing this in CoreGraphics would look like this:
and mathematically equivalent to
p_ = p * M1 * M2
, i.e. the consistent order, although a bit unconventional use of row-vectors for someone coming from a math background, but at least they are super consistent about that when it comes to the order of arguments in API or any explanations in the documentation.