I am trying to implement fireworks effect in C. I have a cube with dimensions 10x10x10. A rocket starts from the ground, and when it reaches 8th floor it explodes. Here\'s the p
It's better to do this using an upside down parabola instead of sin/cos. At the point of explosion give each particle a random horizontal speed. This speed is constant till the particle hits the ground. You also need to give each particle a random vertical speed. this time, however, you'll add to this speed an amount proportional to -0.5*g*dt^2 (strictly speaking, this is numerically wrong, but you won't notice unless you're doing scientific analysis). Here, g is the acceleration due to gravitation and dt is the time step. That's all.