Jump to content
  • Advertisement


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



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

If you intended to correct an error in the post then please contact us.

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);

		glVertex3f(snow[index].x, snow[index].y, snow[index].z);

	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);

Share this post

Link to post
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.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!