Skip to content

Instantly share code, notes, and snippets.

@Nutrox
Created January 13, 2011 21:14
Show Gist options
  • Save Nutrox/778619 to your computer and use it in GitHub Desktop.
Save Nutrox/778619 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