Re: [csswg-drafts] [css-transforms-2] Algorithm for decomposing a 3D matrix, produces different results to 2D matrix (#3230)

Obviously, the quaternion calculation is what we may have to recheck in the spec. About the re-composition code for quaternion, I rechecked the current implementation of [Webkit ](https://searchfox.org/wubkat/rev/b5959d78adc403bde81fdad57864ec9fcf73fa21/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp#564-580), [Blink](https://source.chromium.org/chromium/chromium/src/+/main:ui/gfx/geometry/matrix44.cc;l=665-740;drc=f7c4f08a3c5bbc31ba9916f8372671aef62a34d2), and [Gecko](https://searchfox.org/mozilla-central/rev/132ffbfd6842e5ecd3813673c24da849d3c9acf8/servo/components/style/values/animated/transform.rs#498-519). Webkit and Gecko are simliar, but Blink is different (though I didn't verify if they are identical). And it seems all of them are different from [the spec](https://drafts.csswg.org/css-transforms-2/#recomposing-to-a-3d-matrix).

Perhaps it would be a good change to revisit the quaternion related issues all together:
1. https://github.com/w3c/csswg-drafts/issues/3710
2. https://github.com/w3c/csswg-drafts/issues/9243
(this may be a little bit different from this topic)
3. https://github.com/w3c/csswg-drafts/issues/9278 
(use quaternion directly, instead of composing a matrix3d if there is only rotate3d. If the quaternion calculation in matrix3d has issues, converting the rotate3d into quaternion vector directly may have an inconsistent behavior. This may be also related to #3710).



-- 
GitHub Notification of comment by BorisChiou
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3230#issuecomment-1701907734 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 31 August 2023 23:29:01 UTC