Jelajahi Sumber

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

hybridherbst 3 tahun lalu
induk
melakukan
dded976092
2 mengubah file dengan 18 tambahan dan 0 penghapusan
  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;
 
 	}