Perspective projection is a technique used in computer graphics to create a realistic 3D representation of objects on a 2D image plane. It mimics how our eyes perceive depth and distance in the real world.
The simplest example of a perspective projection is the image produced by our cameras of the film. The cameras capture the three-dimensional world and project them on a two-dimensional film.
The matrix for three-dimensional space projection to a two-dimensional plane is represented by the following matrix:
[ f / aspect 0 0 0 ][ 0 f 0 0 ][ 0 0 (n+f)/(n-f) (2nf)/(n-f) ][ 0 0 -1 0 ]
where:
f
represents the furthest distance up to which objects in the 3D scene will be visible.
aspect
represents the aspect ratio of the image plane.
n
represents the closest distance at which objects in the 3D scene will still be visible in the rendered image.
There are following three types of perspective projection:
In this projection, all lines and objects in the scene converge towards a single vanishing point on the horizon line, providing a sense of depth. For example, the lines converge to a yellow point in the following image.
In the two-point perspective, the receding lines converge to two vanishing points on the horizon line. For example, the lines converge to two yellow points in the following image:
In the three-point perspective, the receding lines converge to three vanishing points, two on the horizon line and one above or below it. For example, the lines converge to three yellow points in the following image:
In this type of projection, there's no convergence towards a vanishing point. A vanishing point and horizon line do not exist in the zero-perspective images. For example, there cannot be a convergence of lines towards a vanishing point in the following image:
Perspective projection is a powerful technique to mimic the sense of three-dimensional depth in a two-dimensional image. Besides computer graphics, perspective projection is also vital in architectural disciplines.
Free Resources