In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: forked from: forked from: forked from: forked from: forked from: flash on 2011-6-5

Get Adobe Flash player
by menboyou 07 Jun 2011
    Embed
/**
 * Copyright menboyou ( http://wonderfl.net/user/menboyou )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/dwu4
 */

// forked from menboyou's forked from: forked from: forked from: forked from: forked from: flash on 2011-6-5
// forked from menboyou's forked from: forked from: forked from: forked from: flash on 2011-6-5
// forked from menboyou's forked from: forked from: forked from: flash on 2011-6-5
// forked from menboyou's forked from: forked from: flash on 2011-6-5
// forked from menboyou's forked from: flash on 2011-6-5
// forked from menboyou's flash on 2011-6-5
// forked from bunta's forked from: forked from: Pv3d練習2。
// forked from peace_s's forked from: Pv3d練習2。
// forked from paq's Pv3d練習2。
// forked from paq's Pv3d練習。
package
{
    import flash.display.*;
    import flash.events.*;
    import flash.text.*;

    import flash.display.*;
    import flash.events.*;
    import flash.geom.*;
    import flash.text.*;
    import flash.filters.*;
    import flash.utils.getTimer;
    import org.papervision3d.core.clipping.FrustumClipping;
    import org.papervision3d.core.proto.MaterialObject3D;
    import org.papervision3d.lights.PointLight3D;
    import org.papervision3d.materials.ColorMaterial;
    import org.papervision3d.materials.MovieMaterial;
    import org.papervision3d.materials.shadematerials.FlatShadeMaterial;
    import org.papervision3d.materials.special.CompositeMaterial;
    import org.papervision3d.materials.utils.MaterialsList;
    import org.papervision3d.materials.WireframeMaterial;
    import org.papervision3d.objects.*;
    import org.papervision3d.objects.primitives.*;
    import org.papervision3d.view.BasicView;
    import org.papervision3d.cameras.*;
    import org.papervision3d.materials.special.Letter3DMaterial;
    import org.papervision3d.typography.fonts.HelveticaBold;
    import org.papervision3d.typography.Text3D;
    import org.papervision3d.core.effects.view.ReflectionView;
    import caurina.transitions.properties.CurveModifiers;
    import caurina.transitions.Tweener;

        [SWF(frameRate = "200", backgroundColor = "0xFFFFFF")]
    public class Main extends ReflectionView {        
        private var wrap:DisplayObject3D;

        public function Main()
        {
            super(0, 0, true , false, CameraType.TARGET);//デフォルトのCameraType常にTARGETの方向を移します。
            
            camera.zoom = 1.5;
            camera.focus = 200;
            wrap = new DisplayObject3D();//3d空間に空のムービークリップオブジェクトを生成するようなもの
            
            // refrection
            surfaceHeight = 0;
            viewportReflection.alpha = .10;

            renderer.clipping = new FrustumClipping(FrustumClipping.NEAR);//カメラが地面に近すぎると消えてしまうのを防ぐクラス

            var compMat:CompositeMaterial = new CompositeMaterial();//複数の素材を組み合わせるクラス
            compMat.addMaterial(new WireframeMaterial(0x6699FF));//WireframeMaterialはワイヤーフレームの部品を作成する
            compMat.addMaterial(new ColorMaterial(0x6699FF, 0.1, true));//一色のカラーマテリアル(部品)を作成する

            var planeB:Plane = new Plane(compMat, 4000, 4000, 6, 6);//
            planeB.pitch(90)
            scene.addChild(planeB);

            var lettermat:Letter3DMaterial = new Letter3DMaterial();//
            lettermat.fillColor = 0x666999;
            lettermat.oneSide = false;
            var word:Text3D = new Text3D("lets-it-support-center" , new HelveticaBold() , lettermat);
                    
            word.x = 0;
            word.y = 200;
            word.z = 0;
            word.scale = 0;

            wrap.addChild(word);
            scene.addChild(wrap);

           Tweener.addTween(word,{scale : 2, time:2, transition:"easeInBounce"});
            this.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
            
            
            var lettermat2:Letter3DMaterial = new Letter3DMaterial();
            lettermat2.fillColor = 0x6699FF;
            lettermat2.oneSide = false;
            var word2:Text3D = new Text3D("x" , new HelveticaBold() , lettermat2);
                    
            word2.x = 0;
            word2.y = 450;
            word2.z = 150;
            word2.scale = 0;

            wrap.addChild(word2);
            scene.addChild(wrap);

           Tweener.addTween(word2,{scale : 2, time:2, transition:"easeInBounce"});
            this.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
            
           
            var lettermat3:Letter3DMaterial = new Letter3DMaterial();
            lettermat3.fillColor = 0x6699FF;
            lettermat3.oneSide = false;
            var word3:Text3D = new Text3D("lets-reform" , new HelveticaBold() , lettermat3);
                    
            word3.x = 0;
            word3.y = 800;
            word3.z = 300;
            word3.scale = 0;

            wrap.addChild(word3);
            scene.addChild(wrap);

           Tweener.addTween(word3,{scale : 3, time:2, transition:"easeInBounce"});
            this.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
            
            
Wonderfl.capture(stage);
        }
        
        private function enterFrameHandler(event:Event):void
        {
            camera.x += (2000 * Math.sin(mouseX / stage.stageWidth * 180 * Math.PI / 180) - camera.x) * .1;
            camera.z += (2000 * Math.cos(mouseX / stage.stageWidth * 360 * Math.PI / 360) - camera.z) * .1;
            camera.y +=  (2000 * mouseY / stage.stageHeight - camera.y) * .10;

            singleRender();
        }
    }
}