O'Reilly logo

Learning Three.js: The JavaScript 3D Library for WebGL by Jos Dirksen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Particles, the particle system, and the BasicParticleMaterial

At the end of the previous section we quickly introduced the ParticleSystem class. Unless you're using the CanvasRenderer class, you'll need a ParticleSystem class to show particles. The constructor of the ParticleSystem class takes two properties: a geometry and a material. The material is used to color and texturize the particles (as we'll see later on), and the geometry defines where the particles are positioned. Each vertex, each point used to define the geometry of the supplied geometry is shown as a particle. When we create a ParticleSystem object based on a CubeGeometry object, we get eight particles, one for each corner of the cube.

Normally, though, you won't create a ParticleSystem ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required