Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

    • CommentAuthorjack1505
    • CommentTimeMay 7th 2011
     
    When the renderer is Away3DRenderer, the flint particle system does work with addInitializer and addAction functions (the particles are initialized by addInitializer, for example, addInitializer( new A3DDisplayObjectClass( Dot, 2 ) ) ). But it does not work when I use an away3d primitive (a sphere) as a particle. I want to set different attributes of the particles. I don't know what is the problem. The program is as follows:

    renderer = new Away3DRenderer( scene );
    ......

    var ExplosionEmitter:Emitter3D = new Emitter3D();

    var particles:Vector.<Particle> = createSphereParticles();
    ExplosionEmitter.addParticles( particles, false );

    ExplosionEmitter.addInitializer( new Velocity( new SphereZone( new Vector3D(), 200 ) ) );
    ExplosionEmitter.addInitializer( new Lifetime( 3 ) );

    ExplosionEmitter.addAction( new Age( Quadratic.easeIn ) );
    ExplosionEmitter.addAction( new Move() );
    ExplosionEmitter.addAction( new Accelerate( new Vector3D( 0, -50, 0 ) ) );

    renderer.addEmitter( ExplosionEmitter );
    ExplosionEmitter.start();

    public function createSphereParticles():Vector.<Particle>
    {
    var particles:Vector.<Particle> = new Vector.<Particle>();
    var p:Particle3D;
    var i:int;
    var sphere:Sphere;

    for(i=0;i<100;i++)
    {
    p=new Particle3D();
    p.position= new Vector3D(0,50,0 ,0);

    sphere = new Sphere();
    sphere.radius = 6;
    sphere.segmentsW = 3;
    sphere.segmentsH = 2;

    p.image = sphere;
    particles.push(p);

    }
    return particles;
    }
    • CommentAuthorRichard
    • CommentTimeMay 9th 2011
     
    I replied to this in the original thread - http://flintparticles.org/forum/comments.php?DiscussionID=474