# Rendering Hypercentric Perspective

I came across some Non-Euclidean Games which involve Hyperbolic Spaces, Spherical Spaces, Portals, etc. And, I noticed that they give quite deep feel of what Non-Euclidean Spaces feel like. So, I was thinking whether space rendering was possible for other unconventional perspectives, for example, Hypercentric Perspective (Objects that are farther away from the lens produce larger images than objects that are closer to the lens, contrary to the human eye where farther-away objects always appear smaller.) Due to physical restrictions, only a handful of images for Hypercentric Perspective exists on the internet, but these should give some idea:

Now, my question is how to render Hypercentric Perspective in preferably 3 Dimensional Space?

I tried doing this in Unity by varying the physical parameters of the virtual physical camera, but it was no success. What can be the other way of approaching the problem? Preferably, the optimal approach? I'm very new to Computer Graphics so please pardon me if I missed something obvious here.

Thank you.

You can approximate the view of a hypercentric camera with an ordinary 3D perspective camera if you are able to manipulate the projection matrix, and/or reverse the direction of the depth test.

In a hypercentric perspective the camera rays converge at a point in front of the camera. This is just the same as a regular perspective camera but with the direction of rays reversed. You can get the same collection of rays by placing an ordinary 3D camera at the hypercentric focal point, aimed backward toward the hypercentric camera lens. Then, you have to render the scene with the depth test reversed (or equivalently, swap the near and far planes in the projection matrix) so that surfaces farthest from the camera (closest to the hypercentric lens) will occlude others. You may also need to flip the direction of the backface culling test.

This should produce a hypercentric perspective. The caveat to this is that it won't render anything farther away than the hypercentric focal point (contrary to a real hypercentric camera). That's because those points are behind the perspective camera, so will get clipped during rasterization. This could however be addressed by rendering the scene in two passes: first draw everything beyond the hypercentric focal point with a camera facing forward (and turned upside down), and then clear the depth buffer and draw everything in front of the hypercentric focal point with the camera facing backward as described above.

It's unlikely that any of this can be accomplished in Unity with the default camera model as it's not designed for these unusual situations. You'll have to get deeper in, to a point where you can manipulate render passes, the depth buffer, and the projection matrix.

You need 2 things:

• View space coordinates of the object
• Projection function for the hypercentric perspective camera.

The second one can be found in here.

The overview of the model

Here is a small discription in case the link goes away.

• You project the point using this \begin{aligned} \left( \begin{array}{@{}c@{}} x_\mathrm {u} \\ y_\mathrm {u} \end{array} \right) = \frac{c}{z_k} \left( \begin{array}{@{}c@{}} x_k \\ y_k \end{array} \right) , \end{aligned} where components with $$k$$ represents the coordiantes of the point in camera space.

• You then model the lens distortion with \begin{aligned} \left( \begin{array}{@{}c@{}} x_\mathrm {d} \\ y_\mathrm {d} \end{array} \right) = \frac{2}{1+\sqrt{1-4\kappa r_\mathrm {u}^2}} \left( \begin{array}{@{}c@{}} x_\mathrm {u} \\ y_\mathrm {u} \end{array} \right) , \end{aligned} where $$r_\mathrm {u}^2=x_\mathrm {u}^2 + y_\mathrm {u}^2$$

• Then you transform the distorted points to image space with \begin{aligned} \left( \begin{array}{@{}c@{}} x_\mathrm {i} \\ y_\mathrm {i} \end{array} \right) = \left( \begin{array}{@{}c@{}} x_\mathrm {d}/s_x+c_x \\ y_\mathrm {d}/s_y+c_y \end{array} \right) , \end{aligned} where where $$s_x$$ and $$s_y$$ are the pixel pitch on the sensor and $$(𝑐_𝑥,𝑐_𝑦)^⊤$$ denotes the principal point.

The description here is very brief, the paper in the link explains various transformations for arriving to the camera space as well; plus other topics such as camera calibration and stereo matching with hypercentric perspective cameras.