소스 검색

use Matrix3.getNormalMatrix

Lewy Blue 7 년 전
부모
커밋
e1af1300ac
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      examples/js/loaders/FBXLoader.js

+ 7 - 4
examples/js/loaders/FBXLoader.js

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