Particle Effects
This is a quick demo I wrote to demonstrate particle effects.
Click on the link below to run the program via Java webstart.
A menu is provided that will allow you to tweak particle
parameters.
I wanted to simulate sparks running along the edges of text.
- First, the program turns a text string into a shape
- Next, the shape is decomposed into it's component Bezier curves
- One or more 'chasers' is them generated for each curved loop.
This is simply a cursor that runs along the edge of each loop
at a constant speed.
- The emit rate is used to emit one particle each time the cursor
has traveled a given distance
- Particles generated at the cursor are given a random direction
and a radius and velocity that is partially randomized.
- The color and transparency of each particle change linearly
as the particle travels over its lifespan
- Pooling of particles is used to preserve memory and speed
execution
Unfortunately, due to the limitations of Java2D, I was not able
to sum the intensities of the particles, which would have given
a more glowing effect. If I have the time to do this in OpenGL, I
will include this effect.
Other possible future features would include providing unusually
shaped sprites for the particles, providing particles with angular
velocity, and possibly environmental effects such as wind or gravity.
Back to
kitfox.com