Skip to content

Instantly share code, notes, and snippets.

@painkkiller
Forked from Nutrox/gist:778619
Created January 15, 2016 20:43
Show Gist options
  • Save painkkiller/190650ed6686980d41c6 to your computer and use it in GitHub Desktop.
Save painkkiller/190650ed6686980d41c6 to your computer and use it in GitHub Desktop.
AS3 - Isometric matrix transformation.
const DEGRAD:Number = Math.PI / 180;
var iso:Matrix = new Matrix();
iso.rotate( -45 * DEGRAD ); // rotate anti-clockwise by 45 degrees
iso.scale( 1.0, 0.5 ); // scale vertically by 50%
iso.translate( 100, 100 ); // set position if needed
displayObject.transform.matrix = iso;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment