Pass the Particle …

…now I have been putting off experimenting with particle systems because … well, no sensioble reasone really, I had just convinced myself they MUST be hard, and love a good self-fulfilling prophesy, dont you?

So, in the script lab, I thought – we need a shower – a cloud of objects that are dynamically spawned (I happen to have already made a drop shape, they will do), they should be effected by gravity, they should “rain” down from a point (I happen to have already made a tap – will modify it so the handle is separate from the tappy bit, that’ll do).

a particle generator - click link below for properties

a particle generator - click link below for properties

ZOOM to see the properties

So I spawned an object, changed it into a “particle emitter” which makes it an invisible system object, customizing it was fairly intuitive (thanks activeworld help), I used the “drip” as the actual thing that made up the generated cloud – a MODEL, and got it to scale and twist it as it fell, making the effect a lot like a water-efficient shower head (you know, the ones you have to run around under to even get wet); I positioned it just under the nozzle of the tap, placed a tap handle above, then went to the scripting of the “off” and “on” buttons.

create color blue; activate tag tap on, rotate 0 5 0 name=handle time=6 reset

…for the “on” button, it starts BLUE, when you click on it (activate) it, the TAP particle emitter turns on;  and the handle begins rotating at a speed of 5 in the Y axis, for 6 seconds and then resets itself (I got the rotation to go a full 180 degrees, that way the reset does not appear to effect it, and the handle looks like it does a half turn). The Off button is RED and rotates in the opposite direction, turning the TAP particle emitter off as it does this – nice

remember to turn off the tap

remember to turn off the tap

The emitter also has a “lifespan”, I set this to 60000 milliseconds (or 1 minute to normal people) meaning that once the emitter/shower is turned on, it automatically turns itself off after a minute – cannot have us wasting water (even virtual water) now can we?

A few things can be used as particles, the next experiment used “SPRITE” – a graphic – I used c_sun ) – the nice thing about this is the image self-masks, making the image a fuzzy-edged soft floaty thing, perfect for a firework.

a flash in the pan?

a flash in the pan?

I generated 3 particle emitters – told each to colour the sprites in shades of red, green and blue, made ON switches for each, an OFF switch that did all 3 and *presto*, a fireworks display is born. I gave each particle emitter a lifespan of 1 minute so you could not accidentally leave it on, nice.

The only effect particle emitters have is to slow down the frame rate for the immediate area – it takes processor hits to generate, move and render from various viewpoints I guess. The effect is lovely, fairly easy to control and useful for creating things like flames, smoke plumes, things that move around in semi-organised clumps.

By widening the “create zone” volume, you can have spawned particles coming from all directions, going in all directions, or by tweaking velocities, acceleration and so on, you can direct the stream, turn on and off gravitational effects etc … very useful indeed.