Raj N. Vaidya wrote:
xnew = xold + sin(theta) * cos(phi ) * delT * randomVelocityMagnitude
ynew = yold + sin(theta) * sin(phi ) * delT * randomVelocityMagnitude
znew = zold + cos(theta)             * delT * randomVelocityMagnitude

where theta is in [0, pi] and phi in [0, 2pi], with theta measured
from the z-axis and phi from the x-axis.
Problem here is that you will get high density at 'poles'. For example,
look at theta = 0. Regardless of value of phi, all particles will point
in one direction. On the other hand, with theta=pi/2, same amount of
particles will cover entire circle at z=0. Of course chances of getting
exactly 0 or pi/2 are minimal, but this tendency holds for values close
to it.

As for the cube-generation+normalization, I think it will also not
generate constant density. Area around corners of cube will be projected
to quite small area on sphere surface, while areas near points of
sphere/cube interesection will get not enough points. You should see
some kind of 3d cross effect with enough number of particles.


My solution ? I think that some kind of modified theta/pi solution can
be used. Phi is ok - problem is with theta, with fact that various
values of theta select quite different areas of choice for phi (circles
at various 'heights' in sphere). I think that making probablity of
choosing specific theta proportional to length of circle selected by it
will solve the problem. I do not want to go into details here, but I
think that following mapping will do the trick

theta = pi/2 + randomsign*pi/2*(random()^2);

With random being uniformly distributed random float ranging from 0 to 1.

Artur

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to