Ever wanted to play Hale-Bopp ?
I made a solar system that simulates newtons and keplers laws of motion using the irrlicht 3d engine... The planets position is calculated according to real data and the scales are proportional to each other, the distance is 1/100000. You can download it, but I'm not going to post a link here... hope you like it.
Quote:
The math needed to calculate accurately the motion of objects within a gravity field (in one, two or even three dimensions) is actually quite simple. We'll be using an iterative method to solve what's called the "two body" problem. We simplify the problem even further to assume the smaller particle has no effect on the black hole.
For each moment in time, we update each particle's position based on its current velocity vector. Next, we calculate the square of the distance between our particle and the black hole. We use this as the (possibly scaled) denominator of a gravity constant to find the force of gravity being felt by the particle, thus implementing the inverse-square-law of gravity (and most other forces). The particle's current velocity vector is then updated to include the force of gravity (the vectors are added together). Lastly, we trim a small amount of velocity away from each particle, in order to simulate a slow decay of the orbits.
This simple algorithm produces true orbital dynamics which subscribe to Kepler and Newton's laws, providing the particles don't approach the singularity too closely. As seen in the image above, the orbits are ellipses, as first realized by Johannes Kepler in the early 1600s after studying the orbits of the planets. Newton later came up with his law of universal gravitation, and showed that orbits can also be parabolic or hyperbolic. Both of the latter orbit forms are "open" (the particle escapes), and can appear in our simulation.
You can find a new version, more info and a download link in the official irrlicht forum
http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=32299
You could change all of the planets masses in a config file, unfortunately however, this very old version is not for download anywhere atm., the whole project advanced quite a bit since then. If I'm in the mood a make another small version like that to toy around with, might happen sooner or later.
I'll write a note when that happens.
zillion42 11 months ago
dont have a clue as to why I cant post a download link here, its in the description. enjoy
zillion42 2 years ago