Flint Particle System Forum - FlarToolKit and FLiNT 2010-12-25T16:55:15+00:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher FlarToolKit and FLiNT http://flintparticles.org/forum/comments.php?DiscussionID=185&Focus=724#Comment_724 2009-03-08T22:59:26+00:00 2010-12-25T16:55:15+00:00 almogdesign http://flintparticles.org/forum/account.php?u=169 Hi I am trying to create a fireworks effect with Flint and the FlarToolKit , how would I start the emitter only when my base node for Flar is showing any help would be appreciated. here is the good ... any help would be appreciated. here is the good that I have so far.
Thanks
Almog

package {

import org.papervision3d.lights.PointLight3D;
import org.papervision3d.materials.WireframeMaterial;
import org.papervision3d.materials.shadematerials.FlatShadeMaterial;
import org.papervision3d.materials.utils.MaterialsList;
//import org.papervision3d.objects.primitives.Cube;
import org.papervision3d.objects.primitives.Plane;

//Imports for fonts
import org.papervision3d.objects.DisplayObject3D;
import org.papervision3d.typography.Text3D;
import org.papervision3d.materials.special.Letter3DMaterial;
import org.papervision3d.typography.fonts.HelveticaBold;
import org.papervision3d.objects.primitives.Sphere;
import org.papervision3d.core.geom.TriangleMesh3D;

//Imports for Particles
import flash.display.Sprite;
import flash.filters.BlurFilter;
import flash.filters.ColorMatrixFilter;
import flash.geom.Rectangle;
import flash.text.TextField;

import org.flintparticles.common.emitters.Emitter;
import org.flintparticles.common.events.EmitterEvent;
import org.flintparticles.common.events.ParticleEvent;
import org.flintparticles.threeD.emitters.Emitter3D;
import org.flintparticles.threeD.geom.Vector3D;
import org.flintparticles.threeD.particles.Particle3D;
import org.flintparticles.threeD.renderers.*;
import org.flintparticles.threeD.renderers.controllers.FirstPersonCamera;
import org.flintparticles.threeD.zones.LineZone;


//Main Class
public class MyExampleFlyingText extends PV3DARApp {

private var _plane:Plane;

private var orbitter:FirstPersonCamera;
private var renderer:BitmapRenderer;

public function MyExampleFlyingText() {
this.init('Data/camera_para.dat','Data/flarlogo.pat');

}

//Init
protected override function onInit():void {
super.onInit();

//Light
var light:PointLight3D = new PointLight3D ;
light.x = 0;
light.y = 1000;
light.z = -1000;


//Plane Base for Shape
//var wmat:WireframeMaterial = new WireframeMaterial(0xff0000,1,2);//
var wmat:FlatShadeMaterial = new FlatShadeMaterial(light,0xff22aa);
this._plane = new Plane(wmat,85,85);// 80mm x 80mm
this._plane.rotationX = 180;//
this._baseNode.addChild(this._plane);// _baseNode addChild
//Material for 3D text
var material:Letter3DMaterial = new Letter3DMaterial(0x548000,1);
material.interactive = true;
material.doubleSided = true;


text3d = new Text3D("Heya", new HelveticaBold(), material);
text3d.scale = .2;
text3d.useOwnContainer = true;
//text3d.rotationY=180;
this._baseNode.addChild(text3d);


renderer = new BitmapRenderer(new Rectangle(-400,-300,800,600),false);
renderer.x = 400;
renderer.y = 300;
renderer.addFilter(new BlurFilter(2,2,1));
renderer.addFilter(new ColorMatrixFilter([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0.95,0]));
addChild(renderer);

renderer.camera.position = new Vector3D(0,150,-400);
renderer.camera.target = new Vector3D(0,150,0);
renderer.camera.projectionDistance = 400;
orbitter = new FirstPersonCamera(stage,renderer.camera);
orbitter.start();

var emitter:Emitter3D = new Whizzer(new LineZone(new Vector3D(-200,0,0),new Vector3D(200,0,0)));
renderer.addEmitter( emitter );
emitter.addEventListener( ParticleEvent.PARTICLE_DEAD, whizzBang, false, 0, true );
emitter.start();


emitter = new CatherineWheel(new Vector3D(200,200,50));
renderer.addEmitter(emitter);
emitter.start();

emitter = new Candle(new Vector3D(150,0,150));
renderer.addEmitter( emitter );
emitter.start();


}

public function whizzBang( ev:ParticleEvent ):void {
var bang:Emitter3D = new SphereBang(Particle3D(ev.particle).position);
bang.addEventListener( EmitterEvent.EMITTER_EMPTY, removeEmitter, false, 0, true );
renderer.addEmitter( bang );
bang.start();
}

public function removeEmitter( ev:EmitterEvent ):void {
Emitter3D(ev.target).removeEventListener( EmitterEvent.EMITTER_EMPTY, removeEmitter );
renderer.removeEmitter( Emitter3D( ev.target ) );
}

public function destroy():void {
for each (var e:Emitter in renderer.emitters) {
e.stop();
}
}

}
}]]>
FlarToolKit and FLiNT http://flintparticles.org/forum/comments.php?DiscussionID=185&Focus=731#Comment_731 2009-03-16T08:44:46+00:00 2009-03-16T08:44:58+00:00 Richard http://flintparticles.org/forum/account.php?u=1 Hi I don't know the FlarToolkit, so can't be specific on this, but emitterReference.start() is what starts the emitter.
I don't know the FlarToolkit, so can't be specific on this, but

emitterReference.start()

is what starts the emitter.]]>
FlarToolKit and FLiNT http://flintparticles.org/forum/comments.php?DiscussionID=185&Focus=738#Comment_738 2009-03-24T21:43:45+00:00 2010-12-25T16:55:15+00:00 almogdesign http://flintparticles.org/forum/account.php?u=169 Hi yea the emitter starts I am having issues trying to add it to the base node.