O'Reilly logo

Irrlicht 1.7 Realtime 3D Engine by Aung Sithu Kyaw, Johannes Stein

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

Time for action - adding a particle system in Irrlicht

Now, let's get started with coding. To create a particle system in Irrlicht, we can use the following procedure:

  1. First we'll add a particle system to our scene.
    IParticleSystemSceneNode* ps = smgr- >addParticleSystemSceneNode(false);
    
  2. Next, we'll create an emitter to emit that particle.
    IParticleEmitter* em = ps->createBoxEmitter(
    aabbox3d<f32>(-5, 0, -5, 5, 1, 5),
    vector3df(0.0f, 0.1f, 0.0f),
    50, 200,
    SColor(0, 0, 0, 255),
    SColor(0, 255, 255, 255),
    800, 1000, 0,
    dimension2df(10.f, 10.f),
    dimension2df(20.f, 20.f));
    
  3. Set the emitter to the particle system we just created and release the emitter since we've already set it to our particle.
    ps->setEmitter(em);
    em->drop();
    
  4. Set the particle system properties. ...

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