Time for action — adding a scaler affector

  1. To show what an affector does, we need a simple Point emitter that emits 30 particles per second with a speed of 20 units and 100 seconds of life:
    emitter Point
    {
    emission_rate 30
    direction 1 0 0
    velocity 20
    time_to_live 100
    }
    
  2. During the whole lifetime of a particle, we want it to grow five times its size per second. For this, we add a Scaler affector:
    affector Scaler
    {
    rate 5
    }
    
  3. Compile and run the application. You should see particles that get bigger with each second they live.
    Time for action — adding a scaler affector

What just happened?

We added an affector that changed the size of our particles for their complete lifetime. The Scaler affector scales each particle per second using the given value. In our case, each particle's size was scaled by a factor of five each second.

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

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