I am having issues with rotation, still… I found a order, and such that works in Terragen, except for the spot light. I have for cameras with all their rotations matching, but the spotlight is just looking off into space.
Is there a difference between these objects rotation? I double-checked, and triple-checked the exporting of the test scene and the eulers are all the same between the objects.
Camera Rotation
obj.rotation.reorder( eulerOrderString );
var rotation = ( Math.round( THREE.Math.radToDeg( obj.rotation.x ) + rotationOffset[0] % 360 ) ) + ' ' + ( Math.round( THREE.Math.radToDeg( obj.rotation.y ) ) + rotationOffset[1] % 360 )
+ ' ' + ( Math.round( THREE.Math.radToDeg( obj.rotation.z ) + rotationOffset[2] % 360 ) );
if ( checkboxProps['swapXZ'] ) {
rotation = ( Math.round( THREE.Math.radToDeg( obj.rotation.z ) + rotationOffset[0] % 360 ) ) + ' ' + ( Math.round( THREE.Math.radToDeg( obj.rotation.y ) ) + rotationOffset[1] % 360 )
+ ' ' + ( Math.round( THREE.Math.radToDeg( obj.rotation.x ) + rotationOffset[2] % 360 ) );
}
Spotlight Rotation
obj.rotation.reorder( eulerOrderString );
var rotation = ( Math.round( THREE.Math.radToDeg( obj.rotation.x ) + rotationOffset[0] % 360 ) ) + ' ' + ( Math.round( THREE.Math.radToDeg( obj.rotation.y ) ) + rotationOffset[1] % 360 )
+ ' ' + ( Math.round( THREE.Math.radToDeg( obj.rotation.z ) + rotationOffset[2] % 360 ) );
if ( checkboxProps['swapXZ'] ) {
rotation = ( Math.round( THREE.Math.radToDeg( obj.rotation.z ) + rotationOffset[0] % 360 ) ) + ' ' + ( Math.round( THREE.Math.radToDeg( obj.rotation.y ) ) + rotationOffset[1] % 360 )
+ ' ' + ( Math.round( THREE.Math.radToDeg( obj.rotation.x ) + rotationOffset[2] % 360 ) );
}