|Part of a series on:|
3D projection is any method of mapping three-dimensional points to a two-dimensional plane. As most current methods for displaying graphical data are based on planar two-dimensional media, the use of this type of projection is widespread, especially in computer graphics, engineering and drafting.
Orthographic projections are a small set of transforms often used to show profile, detail or precise measurements of a three dimensional object. Common names for orthographic projections include plan, cross-section, bird's-eye, and elevation.
If the normal of the viewing plane (the camera direction) is parallel to one of the 3D axes, the mathematical transformation is as follows; To project the 3D point ax, ay, az onto the 2D point bx, by using an orthographic projection parallel to the y axis (profile view), the following equations can be used:
where the vector s is an arbitrary scale factor, and c is an arbitrary offset. These constants are optional, and can be used to properly align the viewport. The projection can be shown using Matrix notation (introducing a temporary vector d for clarity)
While orthographically projected images represent the three dimensional nature of the object projected, they do not represent the object as it would be recorded photographically or perceived by a viewer observing it directly. In particular, parallel lengths at all points in an orthographically projected image are of the same scale regardless of whether they are far away or near to the virtual viewer. As a result, lengths near to the viewer appear foreshortened.
The perspective projection requires greater definition. A conceptual aid to understanding the mechanics of this projection involves treating the 2D projection as being viewed through a camera viewfinder. The camera's position, orientation, and field of view control the behavior of the projection transformation. The following variables are defined to describe this transformation:
Which results in:
First, we define a point as a translation of point into a coordinate system defined by . This is achieved by subtracting from and then applying a vector rotation matrix using to the result. This transformation is often called a camera transform (note that these calculations assume a left-handed system of axes):  
Or, for those less comfortable with matrix multiplication. Signs of angles are inconsistent with matrix form:
This transformed point can then be projected onto the 2D plane using the formula (here, x/y is used as the projection plane, literature also may use x/z):
Or, in matrix form using homogeneous coordinates:
The distance of the viewer from the display surface, , directly relates to the field of view, where is the viewed angle. (Note: This assumes that you map the points (-1,-1) and (1,1) to the corners of your viewing surface)
Subsequent clipping and scaling operations may be necessary to map the 2D plane onto any particular display media.
To determine which screen x coordinate corresponds to a point at Ax,Az multiply the point coordinates by:
the same works for the screen y coordinate:
(where Ax and Ay are coordinates occupied by the object before the perspective transform)