in reply to Re: Re: 3 Dimensional repelling particle simulation
in thread 3 Dimensional repelling particle simulation
Randomly (or equally for that matter) place them on the surface of a very very large sphere. The force between particles is the distance minus the ping. Scale it by a factor of 100 or so (mass of particle). That will be your acceleration (distance and acceleration are vectors remember) for that link. Calculate one for each link the particle has. Store the acceleration per link for later. Go to the next particle and repeat. Note acceleration(a->b) == -acceleration(b->a) if all particles have equal mass. Once you have all of the acceleration vectors for each particle-particle link visit each particle, sum it's acceleration vector (should point roughly towards 0,0,0) and move the particle acceleration times time (assume 1). Repeat. You will have to tune it a bit, what to use for mass, how far apart to start, maybe modify the acceleration calculation to push out harder when particles are too close than it would pull when the particles were too far apart. Over time/iterations it just might converge ;). The usual method would be to stop when the accelerations are all under a certain amount (should approach zero).
|
|---|