Liquid44
Banned
I am releasing a command line application I made a while ago and thought some people might find it interesting.
This is an n-body simulation under gravitational attraction, which means all particles affect every other particle. This can get very computationally expensive due to O(n^2) time complexity (I might optimise it in the future but not now) so that's why I have kept the number of particles fixed at 4096.
The arguments are:
-d = delta time which controls are quickly particles advance every frame
-s = number of frames you want to simulate
-r = number of frames you want to render out
The frames are rendered out as .tga images in the same directory as the executable.
Here is a screenshot of the application running.
Top left shows the program running and right side shows the rendered output image.
The effect produced when you put the images in a sequence is quite cool and forms little clusters that occasionally explode because the force between the particles is inversely proportional to the square of the distance between them.
Virus Scans:
https://www.virustotal.com/en/file/1...is/1371593810/
http://vscan.novirusthanks.org/analysis/6cea83611136036adb868e2753a57dd6/Z3Jhdml0eQ==/
Download:
Download gravity from Sendspace.com - send big files the easy way
Notes:
Compiled under ubuntu 11.04 so this is a linux executable, windows users will have to dual boot or run a virtual machine to use this.
A good value to use for delta time is around 10000.
When I ran the program on my laptop, each frame takes like a minute to render.
I implemented basic error checks so if you enter invalid arguments then it will display example usage.
Written in c++ with no external libraries, I enjoy doing physics simulations so if you have ideas for improvement let me know.
This is an n-body simulation under gravitational attraction, which means all particles affect every other particle. This can get very computationally expensive due to O(n^2) time complexity (I might optimise it in the future but not now) so that's why I have kept the number of particles fixed at 4096.
The arguments are:
-d = delta time which controls are quickly particles advance every frame
-s = number of frames you want to simulate
-r = number of frames you want to render out
The frames are rendered out as .tga images in the same directory as the executable.
Here is a screenshot of the application running.
Top left shows the program running and right side shows the rendered output image.
The effect produced when you put the images in a sequence is quite cool and forms little clusters that occasionally explode because the force between the particles is inversely proportional to the square of the distance between them.
Virus Scans:
https://www.virustotal.com/en/file/1...is/1371593810/
http://vscan.novirusthanks.org/analysis/6cea83611136036adb868e2753a57dd6/Z3Jhdml0eQ==/
Download:
Download gravity from Sendspace.com - send big files the easy way
Notes:
Compiled under ubuntu 11.04 so this is a linux executable, windows users will have to dual boot or run a virtual machine to use this.
A good value to use for delta time is around 10000.
When I ran the program on my laptop, each frame takes like a minute to render.
I implemented basic error checks so if you enter invalid arguments then it will display example usage.
Written in c++ with no external libraries, I enjoy doing physics simulations so if you have ideas for improvement let me know.