Skip to content

Commit

Permalink
Use new 2D Matrix3 transform methods (#24987)
Browse files Browse the repository at this point in the history
  • Loading branch information
WestLangley authored Nov 20, 2022
1 parent bd4667b commit bc82823
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions examples/js/loaders/SVGLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 );

}
Expand Down
8 changes: 4 additions & 4 deletions examples/jsm/loaders/SVGLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {

Expand All @@ -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 );

}
Expand Down

0 comments on commit bc82823

Please sign in to comment.