Visualizing Projections

by @shaunlebron

Everyone knows that a photograph is a 2D image of a 3D world. Take this spinning cube for example:

When the colors of light travel from the object to the camera, they pass through and mark the photo, creating the colored pixels of the image. You can imagine the same scenario from a top-down perspective. Incidentally, this is the same as imagining a 1D image of a 2D object.

Our objective is to illustrate projections using this simplified 2D model.

The Standard Projection

The figure below is an interactive version of the previous diagram. The colored circles represent the objects being photographed. The flat line is the photograph itself.

Try it: Drag the circles.

This is how all 3D graphics today are rendered to your 2D screen. It is the Standard Projection, formally known as the Rectilinear Projection.

Unfortunately, stretching is a nasty side effect of the Standard Projection when used for wide-angle views, and the angle of view must always be less than 180°. To overcome these limitations we can use another projection.

The Panorama

The next figure is a how a panoramic camera takes a picture. The film is no longer flat, but spherical or cylindrical. After the picture is taken, we unroll it onto a flat frame. If we use a cylinder, the projection is formally known as a cylindrical projection. If we use a sphere, the projection is the common fisheye lens (formally known as equidistant azimuthal projection).

Try it: Drag the circles.

We are able to capture a full 360° range without distortion near the margins.

The Hybrid

The stereographic projection is a combination of the Standard and Panoramic projections. It combines the range of the Panoramic Projection with the perspective effects of the Standard Projection (increases the size of the objects near the periphery).

The stereographic projection requires two cameras. The centered camera first projects the image onto the cylinderical or spherical screen, exactly like before. But instead of unrolling it onto a flat frame, we use a second camera to project it onto a flat frame. This is known as a Panini projection if we use a cylinder rather than a sphere.

Try it: Drag the circles.

Other Projection Methods

There are hundreds of other projection methods used in cartography and panoramic photography tools. The aforementioned projections are perhaps the most intuitive to visualize.

Motivation

This was originally intended as a supplement to Blinky, a prototype for trying different projections in a game, where we found the stereographic/Panini to be the best way to represent our natural wide-angle view.

Creating this illustration actually lead to a 1D game concept, BL1ND.

Source Code

https://github.com/shaunlebron/visualizing-projections