wonderfl本刊行記念イベントの直前に作ってみたデモ

by clockmaker
♥0 | Line 32 | Modified 2015-11-22 20:27:34 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    import flash.utils.*;
    import org.papervision3d.view.*
    import org.papervision3d.cameras.*
    import org.papervision3d.objects.primitives.*
    import org.papervision3d.materials.*
    import org.papervision3d.objects.special.ParticleField;
    import org.papervision3d.materials.special.ParticleMaterial;
    
    [SWF(frameRate = 60)]
    public class FlashTest extends BasicView {
        
        private var sphere :Sphere
        
        public function FlashTest() {
             
             opaqueBackground = 0;
             

             // ついでにパーティクルを生成します(彗星)
             var particleMat:ParticleMaterial = new ParticleMaterial(0xFFFFFF, 1)
             var particles:ParticleField = new ParticleField(particleMat, 500, 4, 2000, 2000, 2000)
             scene.addChild( particles );
             
             
             // 球体
             var material :WireframeMaterial = new WireframeMaterial(0xFF0000);
             material.doubleSided = true;
             
             sphere = new Sphere(material, 100, 14, 14);
             sphere.scale = 3;
             scene.addChild(sphere);
             
             startRendering();
            
             addEventListener("enterFrame", loop)
        }
        
        private function loop(e:*):void {
            sphere.rotationY += 2;
            
            camera.x = 1000 * Math.sin(getTimer() / 2000)
            camera.z = 1000 * Math.cos(getTimer() / 2000)
        }
        
        
    }
}

Forked