Continuing our series of pixel-based particle effects, we present a new 3D effect: Kepler's Supernova. We animate 17,000 particles. Click the screen shot below to open the effect in a new window:
- Download all source files corresponding to this effect: keplernova.zip
In Kepler's Supernova we use much larger number of particles than in our earlier bitmap-based particle experiments. Here, we are animating 17,000 particles. Yet, we managed to keep the CPU load from increasing.
In this new example, we have made simplifications in order to make the code more instructive and easier to customize. Our earlier examples made heavy use of external classes which were designed for animating particles. This time, however, we have placed almost all of the code on the timeline so that it can be studied in a more straightforward way. The only external classes we use are a Particle3D class which contains information such as position and color for a particle, plus a very simple Point3D class that the Particle3D class extends. The creation of particles and animation is handled on the timeline.
In Supernova the motion of particles is determined in different way than in our earlier bitmap particle effects. Here, the particles separate depending on the difference between their red and blue color components. We also give the particles a bit of a twist as they fly upwards.
Because the motion is based on properties of pixels in a bitmap, you will obtain slightly different effect when you change the image of Kepler's supernova to your own image. That leaves much room for experimentation.
Enjoy the Supernova and check out some of our earlier bitmap particle effects: