瀏覽代碼

Merge pull request #18082 from WestLangley/dev_fbx_loader

FBXLoader: correctly apply normal matrix to attribute
Mr.doob 5 年之前
父節點
當前提交
87fe6cc875
共有 2 個文件被更改,包括 4 次插入2 次删除
  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 );