CATEGORY


Particle2D: SurfaceEmitter

Some demos of the new emitter type “SurfaceEmitter”. The surface emitter has some useful options. You could decide if to emit from transparent areas or not(see the examples below) and best of all, you could set up a grid resolution parameter for the surface. Think about a large photo, there is not enough CPU-power to emit 20.000+ particles per second, so you have the possibility to create a grid of tiles from the surface.

See how you could change the grid.
[as]
myEmitter = new SurfaceEmitter(x, y, surface);
myEmitter.gridResolution = 5;
[/as]
If you have f.e. an image with a resolution of about 100×100 pixel, the emitter will render only 20×20 tiles. And for sure you have all the possibilities with the surface emitter that you have with the other emitter types(gravity, post effects, etc.). For difficult images you could also set the particle-concentration parameter to prevent performance issues. Last but not least, you could choose between color-matching on or off. And for sure, the surface emitter parameters are fully animateable.

This is the PNG-file i have used to emit from.
letter_p.png

SurfaceEmitter, 300pps, grid-resolution of 2, particle-concentration of 10, no emit from transperant areas
(Move your mouse over the app to start the emit-process)

SurfaceEmitter, 300pps, grid-resolution of 2, particle-concentration of 10, no emit from transperant areas
(Move your mouse over the app to start the emit-process)

Finally, here you can download the updated code base with a quick and dirty class documentation and a test file.

Ps.: I have to give a big credit to the developers of Tweener. It’s a nice and easy-to-use tweening engine. All animations i have done for Particle2D are realized with this nice package.



Introducing Particle2D

Particle2D logo

Particle2D is a ActionScript 3.0 based particle simulator. I started the development because i need an easy-to-implement and animateable particle system. During the development process for this specific project i decided to give it a try and put some time into writing a basic particle simulator framework. There are already some features included, like PostEffects and GravitySimulation or different types of emitters(OmniEmitter, DirectionalEmitter) but there is a lot of work to do.

Have a look at the Demo here.

For the first release i want to have much more emitter types. I think surface or bitmap-emitters would be great. Also the particle-types should be extended (only shapes available until now).

So, now give us some code.
[as]
myEmitter = new OmniEmitter(this.stage.stageWidth / 2, this.stage.stageHeight / 2);
myEmitter.particlesPerSecond = 1000;
[/as]

This two lines initializes a emitter with default values, if you want to change emitter, particleField or particle parameters you have to initialize several other objects. Have a look on how the post effects are applied.
[as]
var postEffects:ParticlePostEffect = new ParticlePostEffect();
postEffects.addPreset(ParticlePostEffect.BLUR);
postEffects.addPreset(ParticlePostEffect.OUTER_GLOW);
myEmitter.particleField.postProcessing = true;
myEmitter.particleField.postEffects = postEffects;
[/as]

As you can see, the postEffects are applied to the particleField. I have implemented some presets for testing, but you can use every Filter that extends the BitmapFilter class.

Particle2D is designed for being a particle simulator which is animateable and reusable. For this reason there are some limitations you should know. Particle2D is not designed for creating a big amount of particles in a short time. The reason is, that the timer which triggers the particle generating process, depends on the current frame rate. The timer event is f.e. at 33 fps only called 330 times or less in a second. That means that in most cases this will be the maximum number.

Finally, here is a quick and dirty developer preview from Particle2D for download and testing.

I would recommend you to NOT use this in a real project.



Avoid 0.0.25

I have to debug some application today in Flash CS3 and after i removed all errors and warnings i expected that Flash would now show me the correct result. But Flash does not.

I had a little mistake when i assinged a number to a variable.

[as]var myNumber:Number = 0.0.25; [/as]

The problem is that neighter the compiler nor the runtime error system recognized this mistake. I decide to post this, because it maybe save someones precious time.



Just ordered

I hope the delivery is soon in my “death-cold-hands”.

NASA (National-Action-Script-Association), muahahaha

51k1rtfqial_ss500_.jpg

513onvq0cl_ss500_.jpg

Ps.: An die Fr. Jellinek, nach dem ich dank rechtschreibkorrigierendem Fremdwirken jetzt endgültig jede Selbsicherheit beim englischen Schreiben verloren habe, ich habe über den Begriff lebende Fremdsprache nachgedacht und welche wirren Konstruktionen im Deutschen gebraucht werden, ich bin der Meinung man kann alles schreiben, so lange es jemand lesen kann.




© 2006 - 2012 Hannes Wolfgang Moser