Time for action — adding randomness

Adding randomness can improve the visual quality of a scene, so let's do it.

  1. Remove the ColorInterpolator affector.
  2. Add a different affector called DirectionRandomiser:
    affector DirectionRandomiser
    {
    
  3. First we define how much influence the affector should have on each axis of our particles:
    randomness 100
    
  4. Then we say how many of our particles should be affected each time the affector is applied. 1.0 stands for 100 percent and 0 for 0 percent. Then we define if we want our particles to keep their velocity or if it should also be changed:
    scope 1
    keep_velocity true
    }
    
  5. Compile and run the application. This time, you shouldn't see a single stream of particles but, rather, a lot of particles flying in not exactly the same ...

Get Ogre 3D 1.7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.