2 ms·
I, like many others on this thread, have dabbled in the Gravity Simulation game. I've done two of them. The first one was back in 1999, I wrote one with 13h[1
by chops 12y ago
I, like many others on this thread, have dabbled in the Gravity Simulation game. I've done two of them.
The first one was back in 1999, I wrote one with 13h[1] graphics for DOS (Borland Turbo C++), and to make it more fun, I used flat sprites to represent the objects (so the objects progressed from being rocks to asteroids to planets - with the largest sprite I used being an image of Jupiter).
A few years later, I rewrote it in OpenGL (using the GLUT library) for a class. It worked much better (and of course the hardware was much faster too).
I had always planned rewriting the physics engine to use Barnes-Hut, but never got around to it, so it always ran at N^2.
Anyway, for the curious, the code is up on Github amongst my collection of other old garbage stuff from back in the day: https://github.com/choptastic/OldCode-Public/tree/master/GravSim https://github.com/choptastic/OldCode-Public/tree/master/Gra...
[1] http://en.wikipedia.org/wiki/Mode_13h http://en.wikipedia.org/wiki/Mode_13h