2
0
sunag 7 жил өмнө
parent
commit
c53365be6e

+ 5 - 12
examples/js/nodes/utils/UVTransformNode.js

@@ -24,21 +24,14 @@ THREE.UVTransformNode.prototype.generate = function ( builder, output ) {
 
 };
 
-THREE.UVTransformNode.prototype.compose = function () {
+THREE.UVTransformNode.prototype.setUvTransform = function ( tx, ty, sx, sy, rotation, cx, cy ) {
 
-	var defaultPivot = new THREE.Vector2( .5, .5 );
+	cx = cx !== undefined ? cx : .5;
+	cy = cy !== undefined ? cy : .5;
 
-	return function compose( translate, scale, rotate, optionalCenter ) {
+	this.transform.value.setUvTransform( tx, ty, sx, sy, rotation, cx, cy );
 
-		optionalCenter = optionalCenter !== undefined ? optionalCenter : defaultPivot;
-
-		this.transform.value.setUvTransform( translate.x, translate.y, scale.x, scale.y, rotate, optionalCenter.x, optionalCenter.y );
-
-		return this;
-
-	};
-
-}();
+};
 
 THREE.UVTransformNode.prototype.toJSON = function ( meta ) {
 

+ 1 - 1
examples/webgl_materials_nodes.html

@@ -861,7 +861,7 @@
 
 					function updateUVTransform() {
 
-						texture.coord.compose( translate, scale, THREE.Math.degToRad( rotate ) );
+						texture.coord.setUvTransform( translate.x, translate.y, scale.x, scale.y, THREE.Math.degToRad( rotate ) );
 
 					}