Skip to content

Fix Matrix3(Matrix4) copy producing transposed linear transform - #29

Open
Sring65 wants to merge 1 commit into
DomCR:masterfrom
Sring65:fix/matrix3-matrix4-transpose
Open

Sring65 wants to merge 1 commit into
DomCR:masterfrom
Sring65:fix/matrix3-matrix4-transpose

Conversation

@Sring65

@Sring65 Sring65 commented Oct 15, 2026

Copy link
Copy Markdown

Matrix4 indexes M[i,j] column-first in its vector operator (X' = M00x + M10y + ...), while Matrix3 indexes row-first (X' = M00x + M01y + ...). Copying the 3x3 block verbatim therefore produced the TRANSPOSE of the intended linear transform, so rotations applied via getWorldMatrix() ran with the wrong sign (arc start/end angles, text rotation, ellipse major axis, etc.).

Transpose the 3x3 block in the Matrix3(Matrix4) constructor so that Matrix3 * XYZ applies the same linear map as Matrix4 * XYZ.

Matrix4 indexes M[i,j] column-first in its vector operator (X' = M00*x + M10*y + ...), while Matrix3 indexes row-first (X' = M00*x + M01*y + ...). Copying the 3x3 block verbatim therefore produced the TRANSPOSE of the intended linear transform, so rotations applied via getWorldMatrix() ran with the wrong sign (arc start/end angles, text rotation, ellipse major axis, etc.).

Transpose the 3x3 block in the Matrix3(Matrix4) constructor so that Matrix3 * XYZ applies the same linear map as Matrix4 * XYZ.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant