You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The two sources describe the same matrices for rotate and scale, but the provided translate matrices are different. Which is correct? Based on what I've looked up, I think MDN is incorrect.
It would also be helpful if the MDN page included the perspective matrix as on W3.
As an additional note, it would be helpful if both pages included the transform-origin matrix.
Do you have any supporting links, references, or citations?
It is really confusing but it actually works. If you look closely at multiplyMatrixAndPoint, we are doing a right-multiplication and treating the point as a row vector, rather than the typical left-multiplication on a column vector. To be fair this probably makes more sense when written down as code, since you write an array horizontally, but maybe we should explain that? I'm not sure.
Josh-Cena
removed
the
needs triage
Triage needed by staff and/or partners. Automatically applied when an issue is opened.
label
Jul 3, 2024
@Josh-Cena Got it, that makes sense. Actually in the MDN page, the array is written horizontally, but I changed the formatting for the post. I think it would be helpful to explain it! Maybe a small note in the Translation matrix section that mentions this. For my part, I was using the page as a reference for what the matrices should look like, and hadn't actually looked too much into the multiplication methods MDN was using, so I missed that.
Josh-Cena
changed the title
"Matrix math for the web - Translation matrix" - Variance vs W3 Specification
WebGL matrix example is using atypical right-mul convention
Jul 3, 2024
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Matrix_math_for_the_web#translation_matrix
What specific section or headline is this issue about?
Translation matrix
What information was incorrect, unhelpful, or incomplete?
MDN describes the
translate
matrix with the following code:The specification on W3 describes the translation matrix as:
What did you expect to see?
The two sources describe the same matrices for
rotate
andscale
, but the providedtranslate
matrices are different. Which is correct? Based on what I've looked up, I think MDN is incorrect.It would also be helpful if the MDN page included the
perspective
matrix as on W3.As an additional note, it would be helpful if both pages included the
transform-origin
matrix.Do you have any supporting links, references, or citations?
https://www.brainvoyager.com/bv/doc/UsersGuide/CoordsAndTransforms/SpatialTransformationMatrices.html
https://gamedev.stackexchange.com/a/124669
https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Matrix_math_for_the_web#translation_matrix
https://www.w3.org/TR/css-transforms-2/#mathematical-description
Do you have anything more you want to share?
No response
The text was updated successfully, but these errors were encountered: