Browse Source

Merge pull request #18082 from WestLangley/dev_fbx_loader

FBXLoader: correctly apply normal matrix to attribute
Mr.doob 5 years ago
parent
commit
87fe6cc875
2 changed files with 4 additions and 2 deletions
  1. 2 1
      examples/js/loaders/FBXLoader.js
  2. 2 1
      examples/jsm/loaders/FBXLoader.js

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

@@ -1616,7 +1616,8 @@ THREE.FBXLoader = ( function () {
 				var normalAttribute = new THREE.Float32BufferAttribute( buffers.normal, 3 );
 
 				var normalMatrix = new THREE.Matrix3().getNormalMatrix( preTransform );
-				normalMatrix.applyToBufferAttribute( normalAttribute );
+
+				normalAttribute.applyNormalMatrix( normalMatrix );
 
 				geo.setAttribute( 'normal', normalAttribute );
 

+ 2 - 1
examples/jsm/loaders/FBXLoader.js

@@ -1664,7 +1664,8 @@ var FBXLoader = ( function () {
 				var normalAttribute = new Float32BufferAttribute( buffers.normal, 3 );
 
 				var normalMatrix = new Matrix3().getNormalMatrix( preTransform );
-				normalMatrix.applyToBufferAttribute( normalAttribute );
+
+				normalAttribute.applyNormalMatrix( normalMatrix );
 
 				geo.setAttribute( 'normal', normalAttribute );