ソースを参照

Merge pull request #12412 from jparimaa/fbx-loader-texture-repeat

FBXLoader: Use texture scaling as a texture repeat value
Mr.doob 7 年 前
コミット
ca6a0cd319
1 ファイル変更15 行追加0 行削除
  1. 15 0
      examples/js/loaders/FBXLoader.js

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

@@ -387,6 +387,21 @@
 		texture.wrapS = valueU === 0 ? THREE.RepeatWrapping : THREE.ClampToEdgeWrapping;
 		texture.wrapT = valueV === 0 ? THREE.RepeatWrapping : THREE.ClampToEdgeWrapping;
 
+		if ( 'Scaling' in textureNode.properties ) {
+
+			var values = textureNode.properties.Scaling.value;
+
+			if ( typeof values === 'string' ) {
+
+				values = parseFloatArray( values );
+
+			}
+
+			texture.repeat.x = values[ 0 ];
+			texture.repeat.y = values[ 1 ];
+
+		}
+
 		loader.setPath( currentPath );
 
 		return texture;