## Random Point Distribution Problems

My method is this:

Code:

`for each particle in particleArray do:`

particle.x=particle.x+randomFrom0To1()*spread;

particle.y=particle.y+randomFrom0To1()*spread;

particle.z=particle.z+randomFrom0To1()*spread;

However it doesn't seem to be working, so are there any problems with how I am doing it?

Is there any better method?

The main thing that pops out to me is that if your random function does what its name implies, you won't get any negative numbers, so you may want to do ((randomFrom0To1() - 0.5) * 2) instead. With more context, we'd probably be able to give you a better answer...

Because I'm slightly bored:

You may also want to consider incorporating some form of a distribution function, probably Gaussian, to give your particle system a more realistic look.

Glad you fixed your problem, though!

You may also want to consider incorporating some form of a distribution function, probably Gaussian, to give your particle system a more realistic look.

Glad you fixed your problem, though!

"Who's John Galt?"