Following our very popular 3D particle effect Kepler's Supernova - 3D Particle Effect in AS3 Flash CS4, we present a new 3D particle effect: Astronaut. In this effect, we animate 15,000 particles and the principles that govern motion of particles are different in this example. Click the screen shot below to open the effect in a new window:
- Download all source files corresponding to this effect: astronaut.zip
In Kepler's Supernova, motion of particles depended on on the difference between particles' red and blue color components. In Astronaut, the particles fly upwards at a height based on their luminance (a measure of brightness).
Similarly as in Kepler's Supernova, we made the code as simple as possible so it would be more instructive and easier to customize. Nearly all the code is placed 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. Also, we tried to minimize the CPU usage by simplifying many features of our earlier experiments.
Because the motion is based on properties of pixels in a bitmap, you will obtain a slightly different effect when you change the image of astronaut to your own image. That leaves much room for experimentation.
Besides Kepler's Supernova, you may find our other bitmap particle effects interesting. Each of them has its unique features: