THREE.Matrix4 makeRotationFromEuler function is wrong.

(*** 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
  • Dev
  • r82
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • Linux
  • Android
  • IOS
Hardware Requirements (graphics card, VR Device, …)

Author: Fantashit

1 thought on “THREE.Matrix4 makeRotationFromEuler function is wrong.

  1. 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.

Comments are closed.