瀏覽代碼

fix: UV Translation was ignored in FBXLoader.js (#23834)

hybridherbst 3 年之前
父節點
當前提交
dded976092
共有 2 個文件被更改,包括 18 次插入0 次删除
  1. 9 0
      examples/js/loaders/FBXLoader.js
  2. 9 0
      examples/jsm/loaders/FBXLoader.js

+ 9 - 0
examples/js/loaders/FBXLoader.js

@@ -325,6 +325,15 @@
 				texture.repeat.y = values[ 1 ];
 
 			}
+			
+			if ( 'Translation' in textureNode ) {
+
+				const values = textureNode.Translation.value;
+
+				texture.offset.x = values[ 0 ];
+				texture.offset.y = values[ 1 ];
+
+			}
 
 			return texture;
 

+ 9 - 0
examples/jsm/loaders/FBXLoader.js

@@ -389,6 +389,15 @@ class FBXTreeParser {
 
 		}
 
+		if ( 'Translation' in textureNode ) {
+
+			const values = textureNode.Translation.value;
+
+			texture.offset.x = values[ 0 ];
+			texture.offset.y = values[ 1 ];
+
+		}
+
 		return texture;
 
 	}