Răsfoiți Sursa

Use new 2D Matrix3 transform methods (#24987)

WestLangley 2 ani în urmă
părinte
comite
bc8282360c
2 a modificat fișierele cu 8 adăugiri și 8 ștergeri
  1. 4 4
      examples/js/loaders/SVGLoader.js
  2. 4 4
      examples/jsm/loaders/SVGLoader.js

+ 4 - 4
examples/js/loaders/SVGLoader.js

@@ -1236,7 +1236,7 @@
 										let cy = 0;
 
 										// Angle
-										angle = - array[ 0 ] * Math.PI / 180;
+										angle = array[ 0 ] * Math.PI / 180;
 										if ( array.length >= 3 ) {
 
 											// Center x, y
@@ -1246,10 +1246,10 @@
 										}
 
 										// Rotate around center (cx, cy)
-										tempTransform1.identity().translate( - cx, - cy );
-										tempTransform2.identity().rotate( angle );
+										tempTransform1.makeTranslation( - cx, - cy );
+										tempTransform2.makeRotation( angle );
 										tempTransform3.multiplyMatrices( tempTransform2, tempTransform1 );
-										tempTransform1.identity().translate( cx, cy );
+										tempTransform1.makeTranslation( cx, cy );
 										currentTransform.multiplyMatrices( tempTransform1, tempTransform3 );
 
 									}

+ 4 - 4
examples/jsm/loaders/SVGLoader.js

@@ -1482,7 +1482,7 @@ class SVGLoader extends Loader {
 									let cy = 0;
 
 									// Angle
-									angle = - array[ 0 ] * Math.PI / 180;
+									angle = array[ 0 ] * Math.PI / 180;
 
 									if ( array.length >= 3 ) {
 
@@ -1493,10 +1493,10 @@ class SVGLoader extends Loader {
 									}
 
 									// Rotate around center (cx, cy)
-									tempTransform1.identity().translate( - cx, - cy );
-									tempTransform2.identity().rotate( angle );
+									tempTransform1.makeTranslation( - cx, - cy );
+									tempTransform2.makeRotation( angle );
 									tempTransform3.multiplyMatrices( tempTransform2, tempTransform1 );
-									tempTransform1.identity().translate( cx, cy );
+									tempTransform1.makeTranslation( cx, cy );
 									currentTransform.multiplyMatrices( tempTransform1, tempTransform3 );
 
 								}