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 :)
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