浏览代码

FBXLoader: Use texture scaling as a texture repeat value

Juha-Pekka Arimaa 7 年之前
父节点
当前提交
7310ec2987
共有 1 个文件被更改,包括 15 次插入0 次删除
  1. 15 0
      examples/js/loaders/FBXLoader.js

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

@@ -385,6 +385,21 @@
 
 		texture.wrapS = valueU === 0 ? THREE.RepeatWrapping : THREE.ClampToEdgeWrapping;
 		texture.wrapT = valueV === 0 ? THREE.RepeatWrapping : THREE.ClampToEdgeWrapping;
+        
+        if ( textureNode.properties.Scaling ) {
+
+            var values = textureNode.properties.Scaling.value
+
+            if ( typeof values === "string" ) {
+                values = values.split(",").map(function(number) {
+                    return parseFloat(number);
+                })
+            }
+            
+            texture.repeat.x = values[0]
+            texture.repeat.y = values[1]
+            
+        }
 
 		loader.setPath( currentPath );