Being able to let particle bounce of some surface can be helpful, so that is what we are going to do here.
Instead of the randomizer, use the
DeflectorPlane
affector:affector DeflectorPlane {
The plane is defined using a point in space and the normal of the plane:
plane_point 0 20 0 plane_normal 0 -1 0
The last thing to define is how the plane should affect the particles that hit it. We want them to keep their original velocity, so we select 1.0 as the value:
bounce 1.0 }
To see the effect of the deflector plane, we need our particles to travel in slightly different directions. So modify the emitter such that the particles' directions differ with a maximal value of 30 degrees. Moreover, as the plane hovers in the sky, our particles should have the up vector as the initial direction.
emitter Point { emission_rate 30 direction 0 1 0 velocity 20 time_to_live 4 angle 30 }
Compile and run the application. The particles bounce off the invisible plane in...