2

I am trying to create a "game" with a hyperbolic world. The goal is to have some objects (for example trees, cars, buildings, cubes, spheres, ...) which are displayed using the Beltrami Klein model. Inspiration were for example the games "Hyperbolica", HyperRogue" and Jeff Weeks Curved Space Flight Simulator.

So far I wrote a shader, that takes the coordinates of the verteces in the Euclidean world (which I can easily create in the editor) and then using the distance and angle (=polar coordinates) places these verteces onto the hyperboloid model, by using the following parametrization:

(x, y, t): $(\sinh{d} \cos{\alpha}|\sinh{d} \sin{\alpha}|\cosh{d})$

The points on the hyperboloid are then projected to the Beltrami Klein Disk by diving the coordinates by the last coordinate: $(x/t, y/t, t/t)$

This works fine for a two dimensional world, but when I tried to apply the same concept for a 3D-world, the struggle began...

My idea was, that I kind of have a hyperboloid with a three-dimensional surface (instead of 2-dimensional), similar to a hypersphere but just with a hyperboloid. When I have a vertex in Euclidean space, I would again take the polar coordinates, which give me a distance d (which would also be an angle on the hyperboloid) and two angles $\alpha,\beta$. These three angles would then be used to calculate the position of the vertex if it was on the hyperboloid, using the parametrization for a 4d hyperboloid.

Parametrization for (x|y|z|t): $(\sinh{d} \cos{\alpha}|\sinh{d} \sin{\alpha} \cos{\beta}|\sinh{d} \sin{\alpha} \sin{\beta}|\cosh{d})$

Then, I would divide by the last coordinate: $(x/t,y/t,z/t,t/t)$, which would give me the coordinates of the verteces on the three-dimensional surface.

The problem is, that it doesn't seem to work the way I expect it to.

So my question is the following:

  • Is there a better approach to define objects/shapes on the hyperboloid directly, without creating a Euclidean world first?

(i was thinking of tiling maybe..., but don't know how)

This is very important for me, so thanks for any answers :)

juwa
  • 29
  • 4
  • The easiest way to map a 3D space to a hyperboloid would be: $(x,y,z)\rightarrow (x,y,z,\sqrt{1+x^2+y^2+z^2})$ – user3257842 Nov 26 '23 at 19:46
  • Your question is about design, specifically graphics design. But this is a site for mathematics questions. – Lee Mosher Nov 28 '23 at 15:55
  • 1
    Why do you need the hyperboloid model? You can map directly the Euclidean space to the Klein ball model preserving distance to the origin and angles at the origin. Isn't this what you want? – Moishe Kohan Nov 29 '23 at 00:33
  • 1
    Precision loss is a major issue you're going to run into if you try to encode the objects using a parameterization involving $\sinh$ and $\cosh$. I've written a renderer which renders basic shapes like a right angled dodecahedron (in true perspective) in $\mathbb{H}^3$, and you can't travel very far in it before things break down.

    Although you asked about rendering in the Beltrami-Klein model, what helped me the most for rendering in true perspective is the paper Real-Time Rendering in Curved Spaces. Specifically the discussion about the appropriate projection matrices to use.

    – Geoffrey Sangston Nov 29 '23 at 02:31
  • I think this thread is probably going to be useful to you. Also, this page by the hyper rogue creator. – Geoffrey Sangston Nov 29 '23 at 02:36
  • Thank you very much for theses comments! @MoisheKohan I have heard of the Klein ball model but don't really know anything about it. Is there a paper or WebPage about it which you would recommend? The way you discribed it sounded promising. – juwa Nov 29 '23 at 16:13
  • @GeoffreySangston, I think I am trying to create something similar to your renderer you mentioned. Would you mind describing me your approach or something? I have already read the paper you mentioned, but I think it doesn't explain how to find proper coordinates, but rather tells you what to do once you have the coordinates (projection, ...). But my problem is especially how to find the coordinates of the verteces of these "shapes". – juwa Nov 29 '23 at 16:19
  • @juwa For pragmatic reasons I store a mesh in its tangent space representation (a Euclidean form of the mesh) and then send the vertices through the exponential map when it comes time to render (i.e. in the shader). That'll distort a Euclidean model, but if your curvature or model is small enough it shouldn't be too noticeable I hope. For the right angled dodecahedron I used hyperbolic trigonometry (I studied Ratcliffe's book but there's probably a lot of good sources) to calculate the distance from its center to its vertex and then exponentiated a Euclidean dodecahedron of that radius. – Geoffrey Sangston Nov 29 '23 at 16:35
  • @juwa I'm basically procrastinating on my actual work right now and have to get back to it, but perhaps over the winter break I'll try to make some kind of write up / tutorial which goes into detail. – Geoffrey Sangston Nov 29 '23 at 17:02
  • @GeoffreySangston Thank You very much! – juwa Nov 29 '23 at 18:43
  • https://en.wikipedia.org/wiki/Beltrami%E2%80%93Klein_model – Moishe Kohan Nov 30 '23 at 02:47
  • @GeoffreySangston What did you get for the distance between the center and the vertices of the dodecahedron? – juwa Dec 04 '23 at 16:50
  • @juwa I answered your question here. – Geoffrey Sangston Dec 04 '23 at 18:42
  • @juwa "The problem is, that it doesn't seem to work the way I expect it to." - Please explain. What were you expecting? – mr_e_man Dec 14 '23 at 20:56
  • @juwa "But my problem is especially how to find the coordinates of the verteces of these "shapes"." - What coordinate system do you want to use? Your post already includes conversions between several coordinate systems. – mr_e_man Dec 14 '23 at 20:59

0 Answers0