Home > Research > Short Notes

Site map

Perspective Projection

Continuing my quest to relate everything to Computer Graphics, here're examples of the famous artist Albrecht Durer engraving himself doing perspective projections in 1525. They are from Hitachi's Viewseum at http://www.viewseum.com/. These are pictures 195, 196, and 197.

Durer's Pictures for Geometry
2

Pictures for Geometry 2.

Durer's Pictures for Geometry
3

Pictures for Geometry 3.

Durer's Pictures for Geometry
4

Pictures for Geometry 4.

Homogeneous Coordinates

Motivation

  1. Some common transformations are translation, scaling, rotation, projection.

  2. Homogeneous coords make a translation or projection into a matrix multiply, like the others.

  3. Now, several successive transformations can be combined into one matrix, which is then applied to the points in the object.

Definition

  1. In 3D, the homogeneous point (xh,yh,zh,w) corresponds to the Cartesian point (xh/w, yh/w, zh/w).

  2. There are an infinite number of homogeneous ways to represent each Cartesian point. E.g., (1,1,1,1), (2,2,2,2) and (3,3,3,3) all correspond to the Cartesian point (1,1,1).

  3. For finite points, w is not 0.

Advantages

  1. Translation is a matrix multiply. To translate by (dx,dy,dz), multiply by this.

    1 0 0 dx
    0 1 0 dy
    0 0 1 dz
    0 0 0 1

    (Note: Standards-compliant browsers display vertical bars on each side of the above 4x4 matrix.)

  2. Projection is a matrix multiply. To project onto the viewplane z=1 with the center at (0,0,0), the equations are thus:

    x' = x/z
    y' = y/z
    z' = 1

    This is the same as multiplying by this matrix:

    1 0 0 0
    0 1 0 0
    0 0 1 0
    0 0 1 0
  3. Points at infinity can be represented. (1,2,3,0) is the infinite point at the end of the line from the origin thru Cartesian (1,2,3).

  4. Therefore, a parallel projection has the same form as a perspective projection, with an infinite center of projection.

  5. In 2-D, every pair of lines intersects. Two parallel lines intersect at infinity. What is the intersection of x=0 and x=1? Write the equations homogeneously thus:

    1x + 0y + 0w = 0
    1x + 0y - 1w = 0

    (All homogeneous equations have 0 as the constant.) The solution is x=0, w=0, y=anything. The lines intersect at (0,1,0). Note that (0,2,0), (0,3,0), etc, are the same point.

  6. Every two different points have one line thru them. If both points are infinite, this is the line at infinity, which contains all infinite points.

  7. Computer aided design uses homogeneous points with 'w' being the weight that a point has when approximating a curve near it. In homogeneous 2D, (1,1,1) and (2,2,2) are the same point, but using (2,2,2) will make the approximating curve come closer.

  8. Suppose we want to represent a circle parametrically. Using Cartesian coordinates, there is no way to do this exactly with polynomials. However, here is an exact homogeneous rep:

    xh = t2-1
    yh = 2t
    w = t2+1

More Projection Matrices

Here are two more examples of how simple homogeneous coordinates make projections.

First, assume that the view plane is z=0, and the center of projection is at (0,0,-d). d>0. Using similar triangles, things scale down by d/(z+d). In Cartesian terms,

x' = xd/(z+d)
y' = yd/(z+d)
z' = 0
In homogeneous terms, this would be
x' = x
y' = y
z' = 0
w' = z/d + w

This is the same as multiplying by this matrix:

1 0 0 0
0 1 0 0
0 0 0 0
0 0 1/d 1

In the limit as d goes to infinity, and this becomes a parallel projection, we get in Cartesian terms,

x' = x
y' = y
z' = 0
In homogeneous terms, this would be
x' = x
y' = y
z' = 0
w' = w

This is the same as multiplying by this matrix:

1 0 0 0
0 1 0 0
0 0 0 0
0 0 0 1

Finally, here is a perspective projection onto an arbitrary view plane, with the center of projection at (0,0,0). Let the equation of the plane be ax+by+cz=1. The point (x,y,z) will project to (x',y',z') with ax'+by'+cz'=1, so its 3 components will be scaled down by 1/(ax+by+cz).

We get in Cartesian terms,

x' = x/(ax+by+cz)
y' = y/(ax+by+cz)
z' = z/(ax+by+cz)
In homogeneous terms, this would be
x' = x
y' = y
z' = z
w' = ax+by+cz

This is the same as multiplying by this matrix:

1 0 0 0
0 1 0 0
0 0 1 0
a b c 0