Explorar o código

Merge pull request #13313 from looeee/FBXLoader_use_getNormalMatrix

FBXLoader: use Matrix3.getNormalMatrix
Mr.doob %!s(int64=7) %!d(string=hai) anos
pai
achega
e92d8a6783
Modificáronse 1 ficheiros con 2 adicións e 6 borrados
  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 );