Source
- URL: https://x.com/NOTimothyLottes/status/1885175713638076657
- Author: NOTimothyLottes (@NOTimothyLottes)
- Posted: 2025-01-31 03:58:09
Thread
1/ @NOTimothyLottes
Comparing matrix to quaternion code:
(A.) https://d3cw3dd2w32x2b.cloudfront.net/wp-content/uploads/2015/01/matrix-to-quat.pdf
(B.) https://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm (Alternative Method)
A with conditional moves is probably faster on CPU
B probably faster on GPU? (sqrt = 4 clk, copysign=BFI)
Anything better than those?
2/ @NOTimothyLottes
The (B.) alternative method might be just 32 VALU clocks on AMD, wrote up the code below (but warning didn’t test it yet).