Jump to content
  • Advertisement
Sign in to follow this  
levjs

Square Particle Effects

This topic is 4073 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

Hi, I'm using a particle engine based off nehe's. Well, the problem is, when I pass my particles random directions and momentums and spawn them from a central point(like a firecracker), they turn out to be squarish. Why is this? I seem to have a dim understanding of why it would be, but since it's only a dim one I have no idea how to go about trying to fix it. Can anyone help? Thanks, Levi [Edited by - levjs on May 21, 2007 8:38:32 PM]

Share this post


Link to post
Share on other sites
Advertisement
Are you initialising the directions with something along the lines of:

Velocity.x = RandomInRange(-1, 1)
Velocity.y = RandomInRange(-1, 1)
Velocity.z = RandomInRange(-1, 1)
Normalise(Velocity)

..?

If so, you're creating a uniform distribution in a cubic domain then squashing it into a sphere, causing bunching from the corners. To create a radially-uniform distribution you'll need to work a little harder. Have a look at this thread. Some more details can be found here.

Admiral

Share this post


Link to post
Share on other sites
I assume you're not normalizing the velocity if you get a square distribution, and doing so would fix the problem. V *= speed/|V| for all particles moving out in a perfect sphere or V*=random*speed/|V| for particles moving out at random speeds with a generally spherical distribution. If you want you're particles to be evenly spaced over this sphere then that's a whole different problem ( already well covered by TheAdmiral).

Share this post


Link to post
Share on other sites
Even distribution doesn't bother me. I just need a fairly spherical shape. Thanks alot, I'll try what you are suggesting. I am not currently at my own computer, so I will try it and get back to you. Thanks alot!
Levi

Share this post


Link to post
Share on other sites
It works!!! Thanks so much. Haha, such a simple solution, I would have never thought of it. : )

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!