I noticed what seems to be a bug in the toEulerZXY function.
I 've got a 3x3 matrix:
(0.422292, -0.829084, -0.366455)
(0.852765, 0.500438, -0.149511)
(0.307345, -0.249362, 0.918345)
When calling toEulerZXY on this matrix I get:
(-0.25202170398728513, 0.32295594277829603, 1.0277313462226352)
which is a different result from what I computed myself : (-0.25202170398728513, -0.3229559427782126, 1.0277313462226272) (sign of second member)
I thought maybe I did a mistake, but when creating a matrix from the value returned by toEulerZXY(using mat3.fromEulerZXY) I get a different matrix from the original one:
(0.557801, -0.829084, -0.0384439)
(0.770971, 0.500438, 0.39391)
(-0.307345, -0.249362, 0.918345)
Using the values I found get me the good matrix.
Can anyone confirmed that the bug is from cgkit(or explained me what I missed)
That's a known bug in cgkit which is already fixed in the svn version.
I'm actually planning on doing a new release within the next few weeks. Until then you could check out the version from svn.
- Matthias -