Gnomonic projection, or rectilinear projection, together with stereographic projection, are two most commonly used projection in rendering 360 degree videos, or other VR applications.

Recently, I found the inverse converting function from screen coordinates to the two projections can be unified within a single function.

It’s not really surprising since both projection uses spherical lens, and the transition from rectilinear to stereographic projection has been used in many VR moviews.

Demo

.

Interaction

  • Click and move your cursor to alter the central point.
  • Press space to compare the gnomonic projection.
  • Press enter for the equirectangular projection.
  • Press 1 for zooming in, which creates a very similar effect as reference [6], if you click the center.
  • Press 2 for zooming out, creating the “little planet” effect in photography.
  • Press 3 for a slight fish-eye lens.

Background

According to Wikipedia: The stereographic projection is a particular mapping that projects a sphere onto a plane. The projection is defined on the entire sphere, except at one point: the projection point. Where it is defined, the mapping is smooth and bijective. It is conformal, meaning that it preserves angles. It is neither isometric nor area-preserving: that is, it preserves neither distances nor the areas of figures. Intuitively, then, the stereographic projection is a way of picturing the sphere as the plane, with some inevitable compromises. Because the sphere and the plane appear in many areas of mathematics and its applications, so does the stereographic projection; it finds use in diverse fields including complex analysis, cartography, geology, and photography. In practice, the projection is carried out by computer or by hand using a special kind of graph paper called a stereographic net, shortened to stereonet, or Wulff net.

A gnomonic map projection displays all great circles as straight lines, resulting in any straight line segment on a gnomonic map showing a geodesic, the shortest route between the segment’s two endpoints. This is achieved by casting surface points of the sphere onto a tangent plane, each landing where a ray from the center of the sphere passes through the point on the surface and then on to the plane. No distortion occurs at the tangent point, but distortion increases rapidly away from it. Less than half of the sphere can be projected onto a finite map. Consequently, a rectilinear photographic lens, which is based on the gnomonic principle, cannot image more than 180 degrees.

 

Open-sourced Code

Example Results