Browse Source

Merge pull request #13313 from looeee/FBXLoader_use_getNormalMatrix

FBXLoader: use Matrix3.getNormalMatrix
Mr.doob 7 years ago
parent
commit
e92d8a6783
1 changed files with 2 additions and 6 deletions
  1. 2 6
      examples/js/loaders/FBXLoader.js

+ 2 - 6
examples/js/loaders/FBXLoader.js

@@ -1099,12 +1099,8 @@
 
 			var normalAttribute = new THREE.Float32BufferAttribute( normalBuffer, 3 );
 
-			var normalsPreTransform = preTransform.clone().setPosition( new THREE.Vector3() );
-
-			// required when preTransform has a non-uniform scale component
-			normalsPreTransform.getInverse( normalsPreTransform ).transpose();
-
-			normalsPreTransform.applyToBufferAttribute( normalAttribute );
+			var normalMatrix = new THREE.Matrix3().getNormalMatrix( preTransform );
+			normalMatrix.applyToBufferAttribute( normalAttribute );
 
 			geo.addAttribute( 'normal', normalAttribute );