Sign in to follow this  

Square Particle Effects

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

This topic is 3861 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this