ParticleMaterial
In this example named ParticleMaterialExample, we will apply the most basic type of particle material. Take the template we just created as a starting point, and change the class definition and the constructor name. To use ParticleMaterial we first need to import it.
import org.papervision3d.materials.special.ParticleMaterial;
Now add this code at the top of the init() method.
var particles:Particles = new Particles(); scene.addChild(particles);
You just instantiated the Particles class and added it to the scene. This instance will display the particles we're about to create inside the for loop.
Inside the loop, add the following:
var particleMaterial:ParticleMaterial = new ParticleMaterial(Math. random()*0xFFFFFF,1,ParticleMaterial.SHAPE_CIRCLE);
We define the material inside the for loop and not before the loop starts, as we want to apply a separate material to each particle. In this example, we give each particle its own color. While instantiating the material we pass...