flash on 2010-12-7

by s.maeda0094
♥0 | Line 54 | Modified 2010-12-20 15:45:49 | MIT License
play

ActionScript3 source code

/**
 * Copyright s.maeda0094 ( http://wonderfl.net/user/s.maeda0094 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/y8Rh
 */

package {
    import org.papervision3d.materials. *;
    import org.papervision3d.scenes.Scene3D;
    import org.papervision3d.objects.primitives. *;
    import org.papervision3d.view. *;
    import flash.events.*;
    
    
    public class Sample extends BasicView {
        public var world:BasicView = new BasicView();
        public var plane:Plane;
        public var plane2:Plane;
        public var plane3:Plane;
        public var plane4:Plane;
        public var plane5:Plane;
        public var plane6:Plane;
        public var plane7:Plane;
        public var plane8:Plane;
        public function Sample():void {
            //マテリアル
            var material:WireframeMaterial = new WireframeMaterial(0x000000);
            //3d
            plane = new Plane(material,4000,4000,6,6);
            scene.addChild(plane);
            plane.y = -70;
            startRendering();
            //plane角度
            plane.rotationX = 90;
 
            plane2 = new Plane(material,150,400,6,6);
            scene.addChild(plane2);
            plane2.x = 320;
            startRendering();

            plane3 = new Plane(material,150,220,6,6);
            scene.addChild(plane3);
            plane3.x = -520;
            plane3.z = -320;
            startRendering();
            
            plane4 = new Plane(material,150,300,6,6);
            scene.addChild(plane4);
            plane4.x = 520;
            plane4.z = 1020;
            startRendering();

            plane5 = new Plane(material,550,300,6,6);
            scene.addChild(plane5);
            plane5.x = -520;
            plane5.z = 1520;
            startRendering();
            
            plane6 = new Plane(material,150,300,6,6);
            scene.addChild(plane6);
            plane6.x = -520;
            plane6.z = 1320;
            startRendering();
                        
            stage.addEventListener(Event.ENTER_FRAME, onFrameHand);
       }
         private function onFrameHand(e:Event):void{
            camera.z += 20;
         }
    }
}