定义一个自定义的坐标转换类
package { import as3isolib.geom.*; import as3isolib.geom.transformations.*; public class MyTransformation implements IAxonometricTransformation { public function MyTransformation () { } public function screenToSpace (screenPt:Pt):Pt { var z:Number = screenPt.z; var y:Number = screenPt.y; var x:Number = screenPt.x; return new Pt(x, y, z); } public function spaceToScreen (spacePt:Pt):Pt { var z:Number = spacePt.z; var y:Number = spacePt.y; var x:Number = spacePt.x; return new Pt(x, y, z); } } }
设置新的坐标转换
package { import as3isolib.geom.*; public class IsoApplication extends Sprite { public function IsoApplication() { IsoMath.transformationObject = new MyTransformation; } } }