Geodesic Asteroids: Classic arcade game gets correct physics
nbodyphysics.com
nbodyphysics.com
The original had correct physics for the simplest possible torus, the mathematically abstract flat one. You've replaced it with correct physics for some arbitrary irregular torus that happens to embed into 3-space :)
(In fact, you can embed the original, flat torus in 4-space, as x² + y² = z² + w² = 1. If you put that into your geodesic solver, all the weird cross terms will go away and you'll get normal Asteroids physics.)
(And now with santaclaus' comment, I'm wondering what geometry I would advocate for a double torus. It can't be flat because of the Euler characteristic or something, but can it at least have constant curvature everywhere?)
To me this is more an example of "correct math", not "correct physics" -- although I suppose it depends on one's point of view :-)
A position on the torus can be specified by specifying the position in the xy-plane, and the position in the zw-plane. Since the projections are both circles, those two positions can be represented by one angle each.
And this is exactly what you see on your screen. The right-left axis is the xy-angle, and the top-bottom axis is the zw-angle. The edges of your screen correspond to an angle of 180/-180 degrees.
The game solves the geodesic equation using the instrinsic geometry of the torus in 2D space without reference to any embedding. It is in this sense that one might call the physics "correct"
The motion is then mapped into either a 2D or 3D representation and I agree this has a strong effect on how things look.
I'll need to think about the four space example.
What is the metric for a mathematically abstract flat torus?
(Also, Mathoverflow relevant to the double torus question: http://mathoverflow.net/questions/194451/canonical-immersion...)
http://0fps.net/2011/09/13/ludum-dare-21-results/
The title of the game was "Help! I'm trapped in a compact riemannian manifold"
You can grab the source for it on GitHub, though the build process is pretty janky as I wrote it in 48 hours and wasn't very careful with the distribution: