Time for action — changing the color
- Instead of the scaler, add a
ColorFader
affector that subtracts 0.25 of each color channel per second:affector ColorFader { red -0.25 green -0.25 blue -0.25 }
- Compile and run the application. You should see how the white particles get darker with each second they live.
What just happened?
We added an affector that changes each color channel during the existence of a particle, using the predefined values.
Have a go hero — change the color to red
Change the colorfader code so the particles fade from white to red. The result should look like this:
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.