perspective drawing
Contents:
- 1 Introduction
- 2 Basic equation for the projection
- 3 Isomorphism of the planar screen to
- 4 The perspective transform in eye coordinates
- 5 Computing the perspective transform in arbitrary coordinates
- 6 Example
- 7 The perspective transform in homogeneous coordinates
- 8 Properties of the perspective transform
- 9 Other models for three-dimensional drawing
1 Introduction
Perspective drawing refers to a particular technique of projecting a three-dimensional scene — mathemetically, some subset of — onto a subset of . The aim is to make the scene look “natural”.
The most common model for perspective drawing consists of an ideal eye or focus at a point , located behind a planar screen that is perpendicular to the unit vector , representing the direction of gaze.
To project a point in front of the screen onto a point on the screen, we find the intersection, with the screen, of the light ray emitted from the point towards the eye :
2 Basic equation for the projection
Let be a point on the screen. Without loss of generality, assume that is anti-parallel to , as in the previous picture. (We can always move the point on the screen.) This means that will be the origin of the perspective drawing.
To calculate the projected point explicitly, we can solve these equations for :
( is on the ray from to ) | ||||
( is on plane centered at perpendicular to ) |
(The notation denotes the dot product in .) The solution is readily found to be:
This satisfies , because the horizontal distance of the point to the screen is less than its horizontal distance to the eye.
From the expression for , we can determine :
(1) |
3 Isomorphism of the planar screen to
Of course, we are interested in displaying or drawing the projected point on a flat screen, so we need to assign coordinates to the screen. In mathematical terms, we seek an (affine) isomorphism to , of the plane centered at and perpendicular to .
The isomorphism is, obviously, not unique in general. But it is uniquely determined if we impose these reasonable conditions:
-
•
Firstly, Euclidean distances on the screen should be preserved when it is transformed into .
-
•
And secondly, if we assign an “up direction” , then this direction should correspond with the unit vector on .
-
•
Similarly, if is a “right”-pointing vector, satisfying , then should map to on . (The minus sign is there to preserve the right-hand rule: the vector should point towards the viewer, which is exactly the opposite of the viewer’s gaze direction.)
Let be the right-handed orthonormal basis for consisting of the vectors , and , where is the gaze direction as before and is a given “up” vector. The vector can be determined by
Then any point on the planar screen is to be mapped to the point , where
(2) |
and is the representation of in the basis .
4 The perspective transform in eye coordinates
The perspective projection (1) takes a simple form in eye coordinates (coordinates with respect to the basis ). We derive it now.
Let , and . Then equation (1) can be rewritten:
We can write out the last vector equation in coordinates. Let and for some (the distance of the eye from the screen). Then
Thus, according to equation (2), the perspective transform of onto is given by
(3) |
5 Computing the perspective transform in arbitrary coordinates
Finally, we want explicit expressions for the perspective transform in terms of coordinates of an arbitrarily given orthonormal basis for . (For example, might be the standard basis.)
The matrix that changes from coordinates to coordinates this matrix composed of three column vectors:
The matrix that changes from coordinates to coordinates is the inverse to ; but both matrices are orthogonal, so the inverse simplifies to the transpose:
Therefore, to obtain the perspective transform of a given point given in coordinates, we are to compute the matrix product
(4) |
6 Example
This figure was created using the MetaPost programming language. MetaPost by itself has no facilities to produce three-dimensional graphics, so the \PMlinktofilesource code for this drawingcube.mp implements formulae (3) and (4) directly.
7 The perspective transform in homogeneous coordinates
The operation described by formula (3) is not linear in or , so it cannot be represented by a matrix. But using homogeneous coordinates, the perspective transform can be represented by the following matrix (with respect to eye coordinates):
8 Properties of the perspective transform
(To be written. Talk about the fact that lines are mapped to lines by the perspective transform, and vanishing points.)
9 Other models for three-dimensional drawing
(To be written. Talk about orthographic projection (and relate it to the special case where ). Could also mention the pin-hole camera model, or even more complicated models with non-infinitesimal lens.)
Title | perspective drawing |
---|---|
Canonical name | PerspectiveDrawing |
Date of creation | 2013-03-22 15:41:10 |
Last modified on | 2013-03-22 15:41:10 |
Owner | stevecheng (10074) |
Last modified by | stevecheng (10074) |
Numerical id | 12 |
Author | stevecheng (10074) |
Entry type | Topic |
Classification | msc 51N20 |
Classification | msc 15A90 |