#### Archived

This topic is now archived and is closed to further replies.

# particles

This topic is 6180 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

So far with every particle effect I''ve made there has always been a spurt of particles at the very front before the actual bunch of particles start coming out. What can I do to make that stop? I have no idea what I''m doing wrong. Here is an example of what I''m doing to make snow if it helps:
  // this is in main loop for (int index = 0; index < MAX_PARTICLES; index++) { glColor4f(1.0f, 1.0f, 1.0f, snow[index].life); glBegin(GL_POINTS); glVertex3f(snow[index].x, snow[index].y, snow[index].z); glEnd(); snow[index].life -= snow[index].fade; snow[index].y -= snow[index].ys; if (snow[index].life <= 0.0f) { snow[index].life = 1.0f; snow[index].fade = random(0.001f, 0.003f); snow[index].x = random(-4.0f, 4.0f); snow[index].y = 3.2f; snow[index].z = random(-1.5f, -3.5f); snow[index].ys = random(0.009f, 0.012); } } 
Thanks.

##### Share on other sites
The problem is that when your algorithm starts, you create MAX_PARTICLES and shoot them off. One thing you might do, is add a delay field to your particle struct, and initialize it with a random value when you initially create your particles. On your display/animation loop, skip the particles with a positive delay, only decrementing it. Once the delay reaches zero, do a reset of the particle and fire it off.

1. 1
Rutin
44
2. 2
3. 3
4. 4
5. 5

• 9
• 9
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632983
• Total Posts
3009706
• ### Who's Online (See full list)

There are no registered users currently online

×