Java Reference
In-Depth Information
Figure 2-4. Calculating a random direction
Performance Consideration The number of particles can grow very quickly in a scene, and while particle
systems are easy ways to spiff up an application, too many particles will bring any computer to its knees.
Example 3: Transparency
The previous examples used very simple particles, just red circles. Now that the framework for a particle
system is in place, it is time to start customizing the particles to produce some remarkable effects. In this
example, we will continue to use simple circles, but we will modify how the circles are drawn.
Particle systems show their strengths when the particles mix together on the screen. To achieve a
rudimentary mixing effect, we can adjust the transparency of the particles. This creates a more
compelling visual effect as the partially transparent particles overlap in random ways to produce regions
of random shape and color density.
Search WWH ::




Custom Search