'THREE.js rotations not mtaching FBX settings

I have set Y+ is UP and Z+ is FORWARD in the FBX export, which matches the coordinate system of Terragen, but unfortunately, when I convert the rotations to 360 degrees, they are not matching the source cameras. Have I done something wrong?

Source Camera Objects Converted Cameras Imported in Terragen

And the code I am using to convert the rotations (found here):

  // Camera Rotation in XYZ Degrees
  cameraRotation = ( Math.round( THREE.Math.radToDeg( camera.rotation.x ) % 360 ) ) + ' ' + ( Math.round( THREE.Math.radToDeg( camera.rotation.y ) % 360 ) ) 
    + ' ' + ( Math.round( THREE.Math.radToDeg( camera.rotation.z ) % 360 ) );

The XML shader value expects a three value vector seperated by spaces, that's why it is formatted strangely.

I would have posted this on the Three.js forums, but the post button has vanished for me on new topics. I guess I ask too many questions.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source