In this course we will be developing games that will reside in a virtual 3D world. One of the principal powers of graphics cards are their ability to render a 3D scene in 2 dimensions, on you monitor. When coding a 3D scene with your program you have a great deal of flexibility in how it will be projected onto you monitor. There are quite a few parameters that will be used to get the effect you desire. For example you may want a wide angle effect, or you may want to have an effect similar to looking through a telescope. The first enhance perspective while the later reduces perspective. In this section we will look at what parameters are needed to define these different effects.

3D too 2D

This problem of projecting a 3D scene onto a 2D plane is not a new one. When the rennaisance got into full swing in Europe portraying a 3D scene in a painting with realistic perspective was one of the main challenges. Techniques were developed that helped create realistic perspective.

In the Durer etching below a very 3D model is lying to the left of a transparent grid. The artist on the right uses the grid to map what he sees onto a sheet of paper marked with an identical scaled grid. He keeps his viewpoint fixed by squinting with one eye passed the point of a fixed needle.

This technique reproduces a convincing perspective drawing, as long as the artist has reasonable copying skills. In fact the finer the grid the less the result depends on artist skill and the more likely the scene which is presented to the artist will be reproduced faithfully.

The technique illustrated by Durer above mimics the way your graphics card projects a 3D scene onto your monitor. It is worth trying this technique for a number of different arrangements.

Exercise: Mark a grid on a window and a scaled grid onto a piece of paper. Draw the scene through the window from many different vantage points.
Also try the following.