PDA

View Full Version : phun with physics


AlexP
08-16-05, 05:11 PM
hey, first post :)

I'd like to share a little video I made by combining around 6000 screenshots of a program I wrote and ran over three days... Basically there are 5000 "particles" that start in a small area, each of which effects the other with gravity assuming a mass of 1 for each particle they attract each other with a strength of G/distance^2... I noticed that with different amounts of particles G would have to be changed accordingly otherwise they either don't do much, or explode away from each other never to return... Running this little experiment brought to my mind how lucky we are to live in a universe where gravity and indeed all other forces are in such a good balance as to allow particles to interact in ways which facilitate our present existance... but I digress...

http://www.enigmatron.com/misc/out.rar contains a compressed version of the video, its about 5 minutes long. Compressed its about 29Mb.

I wish to develop this program further so that different fields and particle types can be thrown into the mix. Even if this kind of thing already exists, I don't know where to start looking for it, and whether it would run on a home computer. Besides, I'd like to develop this myself as a learning experience. Any suggestions for what kind of improvements and additions I should make?

Regards,
Alex

(p.s. feel free to email me if you want to talk about this some more.. or if you have trouble getting the file off my server.. or whatever)

UnderWhelmed
08-16-05, 06:56 PM
What file type is .rar?

AlexP
08-16-05, 07:00 PM
its an archive that can be uncompressed with winrar, or some other suitable un-rar-er. The video file itself is an AVI.

I should have stipulated this in my first post.

fo3
08-17-05, 03:52 AM
Have you set a limit of how close two particles can get to each other or are they just points? Because if they are, then abnormal acceleration can be achieved, as a particle happens to get very close to another and encounters a enormous acceleration, pulling it towards and past the particle and by the time of the next frame it is much further from the particle then it should be.
You probably have already thought of this, but it was something that i encountered when i tried programming a similar thing in flash, but for much smaller amount of particles.

AlexP
08-17-05, 03:45 PM
Actally they're just points. If I put in another field that repels so that the two overlap in such a way as when particles get really close, the repulsion negates and then reverses the effect of the gravity, that would almost be like a totally elastic collision right? I wonder if this will enable particles to group together and orbit one another etc... I might check it out...