Browse Source

FBXLoader: Use texture scaling as a texture repeat value

Juha-Pekka Arimaa 7 years ago
parent
commit
7310ec2987
1 changed files with 15 additions and 0 deletions
  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.wrapS = valueU === 0 ? THREE.RepeatWrapping : THREE.ClampToEdgeWrapping;
 		texture.wrapT = valueV === 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 );
 		loader.setPath( currentPath );