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/transform.cc;l=66-84;drc=6f4c64436342c818aa41e6a5c55034e74ec9c6b6), and [Gecko](https://searchfox.org/mozilla-central/rev/132ffbfd6842e5ecd3813673c24da849d3c9acf8/servo/components/style/values/animated/transform.rs#498-519). They are similar, but different from [the spec](https://drafts.csswg.org/css-transforms-2/#recomposing-to-a-3d-matrix). Not sure which one is correct anyway, but I suspect we should update the spec.

Perhaps it would be a good change to revisit the spec for the quaternion part, and the 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-1701928133 using your GitHub account


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

Received on Friday, 1 September 2023 00:02:51 UTC