There's really no need to store memory for every particle and animate each particle separately. You can do it procedurally by reconstructing the particle position during drawing by using the classic physics equation. s = ut + 1/2.a.t^2
A simple example (without constant acceleration of particles):
void drawExplosion(ExplosionParameters& s)
{
Random rng;
rng.seed(s.startSeed);
glBegin(GL_POINTS);
for (int i = 0; i < s.numParticles; i++)
{
vec3 vel = rng.getRandomVector(-1.0f, 1.0f) * s.explosionSpeed;
float timeBias = rng.getRandom(0, s.particleTimeBias);
vec3 pos = s.explosionCentre + (vel * (s.timeElapsed + timeBias));
glPoint3fv(&pos);
}
glEnd();
}
Then you simply increase s.timeElapsed on every iteration of your update loop.
It is also completely amenable to being implemented on the GPU thus freeing up your CPU from having to do any work. A gpu implementation might look like this:
void drawExplosion(ExplosionParameters& s)
{
//bind Vertex Shader If Not Already Bound();
...
// bindVertexBuffer of Zeroes If Not AlreadyBound();
glVertexPointer(...)
//uploadShaderUniformsForExplosion(s);
glUniform3f(...)
...
glDrawArrays(GL_POINTS, 0, s.numParticles);
}
The GPU vertex shader would then reconstruct the particle position via the physics equation and the uniforms/constants passed to it - just as the CPU version did.
To add some variance, you can use more simultaneous explosions with slightly differing parameters, animating colors/alpha, choosing differing starting positions. etc.