-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
THREE.Matrix4 makeRotationFromEuler function is wrong. #10485
Comments
In three.js, Euler angles are of the intrinsic Tait-Bryan type. Rotations are performed with respect to the local coordinate system. That is, for order XYZ, the rotation is first around X, then around local-Y (which may now be different from the world Y-axis), then local-Z (which may be different from the world Z-axis). If the rotations are performed with respect to the static world coordinate system, instead of the local coordinate system, then the angles are referred to as extrinsic Euler angles. In that case, for order XYZ, the rotations are around world-X, world-Y, and world-Z. Euler order XYZ when the angles are interpreted as intrinsic angles is equivalent to order ZYX when the same angles are interpreted as extrinsic angles. So a reasonable assumption would be that the FBX Euler angles are extrinsic. To convert to three.js angles, reverse the order. |
I'll add a note on this to the docs. @WestLangley actually there is quite a bit of useful info in your responses and StackOverflow posts - do you mind if I plagiarise some of it? |
@looeee OK |
That doesn't sound right to me. Care to provide a proof link? Also, Wiki says:
And |
Three.js uses one of the two most commonly used conventions. Actually Tait-Bryan are probably more commonly used than 'proper' Euler angles. Intrinsic Tait-Bryan Euler angles are also known as yaw, pitch, and roll.
Hmm, this could be written a bit better, as the initial XYZ should be XY'Z'' to show that these are local axes rather than world axes. Something like:
You can find proofs of the intrinsic to extrinsic transform online. Here's one discussion. Feel free to double check it and update the docs if there is a mistake (there's an "edit button in the top right of each page). |
It is not correct to say intrinsic Tait-Bryan Euler angles are "known as yaw, pitch, and roll". That is only true in certain use cases -- in spite of what you may have read on Wikipedia. Please see the section https://en.wikipedia.org/wiki/Euler_angles#Conventions_2. I believe that section is accurate.
"Proper" Euler angles do not apply to us. Also, the If we were to change the default Euler order in three.js, I would select |
Three.js defaults to Tait-Bryan XYZ, while Wikipedia says that one of the conventions is Tait-Bryan ZYX. These are not the same, hence Three.js does not use a common convention.
Thanks, that's an interesting read! @WestLangley |
(*** This section is for bug reports and feature requests only. This is NOT a help site. Do not ask help questions here. If you need help, please use stackoverflow. ***)
Description of the problem
For the matrix is column major and right multiplication in three js, which means column elements are placed in adjacent memory address, the matrix made from euler order 'XYZ' is actually that of 'ZYX'. I didn't check other euler orders yet. I found this because the euler angles which I exported from FBX file is 'XYZ' order, but I have to set them to 'ZYX' to get the right result in three js. Or I was wrong, if three js rotation is based on the local coordination of object instead of that of it's parent.
Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)
The text was updated successfully, but these errors were encountered: