Browse Source

Examples: Clean up (#31030)

WestLangley 8 tháng trước cách đây
mục cha
commit
6b9622144c
1 tập tin đã thay đổi với 2 bổ sung11 xóa
  1. 2 11
      examples/webgl_materials_texture_rotation.html

+ 2 - 11
examples/webgl_materials_texture_rotation.html

@@ -71,7 +71,7 @@
 					texture.anisotropy = renderer.capabilities.getMaxAnisotropy();
 					texture.colorSpace = THREE.SRGBColorSpace;
 
-					//texture.matrixAutoUpdate = false; // default true; set to false to update texture.matrix manually
+					//texture.matrixAutoUpdate = false; // default is true; set to false to update texture.matrix manually
 
 					const material = new THREE.MeshBasicMaterial( { map: texture } );
 
@@ -122,16 +122,7 @@
 				} else {
 
 					// setting the matrix uv transform directly
-					//texture.matrix.setUvTransform( API.offsetX, API.offsetY, API.repeatX, API.repeatY, API.rotation, API.centerX, API.centerY );
-
-					// another way...
-					texture.matrix
-					    .identity()
-					    .translate( - API.centerX, - API.centerY )
-					    .rotate( API.rotation )					// I don't understand how rotation can precede scale, but it seems to be required...
-					    .scale( API.repeatX, API.repeatY )
-					    .translate( API.centerX, API.centerY )
-					    .translate( API.offsetX, API.offsetY );
+					texture.matrix.setUvTransform( API.offsetX, API.offsetY, API.repeatX, API.repeatY, API.rotation, API.centerX, API.centerY );
 
 				}
 

粤ICP备19079148号