/** * ... * @author ever5u */ public class fuxi extends Sprite { private var scene:Scene3D; private var camera:Camera3D; public function fuxi() { stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; //創(chuàng)建一個(gè)攝像機(jī) camera = new Camera3D(300, 300); camera.x = 100; camera.y = 100; camera.z = -300; camera.lookAt(0,0,0); //創(chuàng)建一個(gè) Group var root:Group = createScene(); //創(chuàng)建場景 scene = new Scene3D( "scene", this, camera, root ); //創(chuàng)建實(shí)時(shí)偵聽 addEventListener( Event.ENTER_FRAME, enterFrameHandler ); stage.addEventListener (Event.RESIZE, onResize); } var box = new Box("box", 100, 100, 100); var Plane:Plane3D; public function createScene() { var g:Group = new Group();
//在場景畫一個(gè)坐標(biāo)定位點(diǎn) Plane = new Plane3D("Texture", 300, 300); var myXLine:Line3D = new Line3D( "x-coord", new Point3D( -20, 0, 0), new Point3D( 20, 0, 0 )); var myYLine:Line3D = new Line3D( "y-coord", new Point3D(0, -20, 0), new Point3D( 0, 20, 0 )); var myZLine:Line3D = new Line3D( "z-coord", new Point3D(0, 0, -20), new Point3D( 0, 0, 20 ));