Time for action — some new parameters

We will add some new parameter.

  1. Add to the point emitter the following three new parameters:
    angle 30
    time_to_live 10
    color 1 0 0 1
    
  2. Compile and run the application. You should see red particles flying in slightly different directions.
    Time for action — some new parameters

What just happened?

We added three parameters that changed the behavior of our particle system. Now the particles are red and fly in different directions. The parameter angle defines how many degrees each created particle can differentiate from the given direction. Ogre 3D used a random generator to generate the direction, which is in the given range. Because the direction can be moved up to 30 degrees, some of our particles can fly into the ground.

The parameter time_to_live sets the lifetime of each particle, in our case, to 10 seconds. The default is 5. And with this, we doubled the life expectations of each particle so we can observe their behavior longer.

The color parameter sets the vertex color of the particles to the given color vector, in our case, red.

Pop quiz — what makes a particle system

Name the three components that make a particle system; which of them is optional?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.4.181