Papervision Particles
March 24th, 2008 Posted in Papervision
A few weeks ago I started teaching basic papervision in my 4th semester Flash class (Digital Media Arts program @ Seneca College). So far we have covered basic class imports, setting up the scenes, viewports, render engines, and adding basic prims. However, students are always impatient to get to the fun stuff! So I decided to start taking a look at basic materials and shaders (Andy Zupko has a really good shader tutorial to get you started).
Getting a basic particle field to work in pv3 is dead simple. I did a bit of digging through the class structure and came across ParticleField.as. We start with the following two imports:
import org.papervision3d.materials.special.ParticleMaterial; import org.papervision3d.objects.special.ParticleField;
We will then create a basic function to build our particle field:
private function createParticles():void
{
//Create a new particle material;var pm:ParticleMaterial = new ParticleMaterial(0xFFFFFF,1);
//Create a new particlefield.
var particleField:ParticleField = new ParticleField(pm, 2000, 5000, 5000, 5000);
scene.addChild(particleField);
}
Pretty easy eh!










September 15th, 2008 at 12:41 am
Thanks for that very simple and straight forward code sample, ParticleField was just what I was looking for and didn’t know existed.
September 15th, 2008 at 8:41 am
No problem…You can find lots more stuff here http://www.pv3world.com