Browse Source

FBXLoader_fix_euler_from_array

Lewy Blue 7 years ago
parent
commit
c6319ae508
1 changed files with 5 additions and 1 deletions
  1. 5 1
      examples/js/loaders/FBXLoader.js

+ 5 - 1
examples/js/loaders/FBXLoader.js

@@ -1796,7 +1796,11 @@
 
 
 			if ( 'PreRotation' in node.properties ) {
 			if ( 'PreRotation' in node.properties ) {
 
 
-				var preRotations = new THREE.Euler().fromArray( node.properties.PreRotation.value.map( THREE.Math.degToRad ), 'ZYX' );
+				var array = node.properties.PreRotation.value.map( THREE.Math.degToRad );
+				array[ 3 ] = 'ZYX';
+
+				var preRotations = new THREE.Euler().fromArray( array );
+
 				preRotations = new THREE.Quaternion().setFromEuler( preRotations );
 				preRotations = new THREE.Quaternion().setFromEuler( preRotations );
 				var currentRotation = new THREE.Quaternion().setFromEuler( model.rotation );
 				var currentRotation = new THREE.Quaternion().setFromEuler( model.rotation );
 				preRotations.multiply( currentRotation );
 				preRotations.multiply( currentRotation );