Part III: Projective Geometry in 3D

Daniel Lenton
7 min readJun 15, 2019

--

A short blog post extending the ideas of projective geometry and homogeneous co-ordinates from 2D space to full 3D space

A rather “homogeneous” council of Rick Sanchez’s… (yes I am making the same joke twice, problem?)

Before diving in, it is worth emphasizing that everything covered in this post is derived from chapter 3.1 and 3.2 of the well known Hartley Zisserman book, in particular pages 65–73. If you would like a more formal description on any of the topics subsequently covered, this online book could therefore serve as a helpful complimentary resource. For a softer entry into the topic, though, I would strongly recommend starting with this blog post!

Right… Still here? So let’s get to it.

We have already covered homogeneous co-ordinates for points and lines in 2D space, and you’ll be glad to know that the fundamental ideas are very similar when we extend to 3D space. However, we now also have planes to contend with. As we shall soon see, these planes take on a similar role as lines did in 2D space, particularly when it comes to the simple join and incidence relations with points (I’m referring to all of those very helpful equations that we derived in the original post).

It is actually 3D lines which cause the most difficult when dealing with 3D space. For this reason, we will first explain how 3D points and 3D planes are expressed in homogeneous co-ordinates, and then finally explain a number of options for representing 3D lines. We will then move onto all of the helpful equations that arise in 3D space, particularly between points and planes. Fun fun fun!

Points

Euclidean Vector Representation

In standard Euclidean space, using column vector notation, we would normally represent a 3D point x as follows:

Homogeneous Representation

However, for homogeneous co-ordinates, as was the case in 2D, we simply add an extra dimension to the bottom of the vector, with an entry of 1, and multiply the entire new vector by an arbitrary scaling factor kp, like so:

In order to transform back to our original x, y, z representation, we simply divide the first three vector entries by the fourth entry (which is always equal to the scaling factor kp), and we arrive back at our original x, y and z terms.

So, that’s all well and good, everything is basically the same as in 2D space, but with an extra dimension. So how about for 3D planes?

Planes

In standard Euclidean space, as was the case for lines in 2D space, we actually have a number of different options for representing a plane.

Vector Representation

Using vector notation, given 3 different points on the plane represented as vectors a, b, and C, we can parameterize any other point x on the plane as follows:

In this case, the parameters λ and γ are scalars, which when varied, essentially moves us along the surface of the plane, and returns us the vector representation of the point on the plane x. Note that, in order for the equation above to represent a plane and not a line, the three points a, b and c must not be collinear. In other words, the three points must not all lie on the same line.

As with any vector equation, the equation above essentially encapsulates a number of separate scalar equations, in this case three, one for each of the x, y and z co-ordinates:

Scalar Representation

It is also possible to represent a 3D plane with only a single scalar equation. Consider the diagram of a general 3D plane below:

n defines the unit normal to the plane, and [x0,y0,z0] is an arbitrarily selected point on the plane, let’s call this point x0. Let’s also denote an arbitrary point on the plane [x,y,z] as x. Any vector joining x0 to x is necessarily perpendicular to the vector n, and so it’s dot product with n must be zero:

We can expand this equation in order to arrive at a single scalar equation which encapsulates the constraints between our x, y and z co-ordinates for points which lie on the plane:

This should look very familiar to you, when thinking back to our representation of 2D lines in our previous post on homogeneous co-ordinates in 2D space, which had the following form:

As was the case for 2D lines, we can clearly scale the left and right hand side of our plane equation by an arbitrary factor, and still not change the validity of the equation. Our 3D plane therefore has 3 degrees of freedom, defined by the three unique ratios between our scalar terms a, b, c, and d.

But this doesn’t really give us much intuition for where these three degrees of freedom come from, what do they look like? Well, this is actually quite easy to see. Firstly, consider the normal vector n. The length of this vector has no significance in determining the orientation of the plane. In fact, it’s easiest to think of this as a unit vector. If it is a unit vector, then it only has two degrees of freedom, despite being represented by 3 values. The easiest way to see this is by converting to spherical co-ordinates, which are in general given by the following conversion:

If the vector is a unit vector, then the radius r is 1, and so the vector is fully defined by angles θ and φ. We can therefore write the vector n as follows:

But what about our d term, do we have a more meaningful interpretation for this as well? Well, (referring to this wolfram alpha article for more details), we can actually deduce the following relation for the origin-to-plane shortest distance D:

If we do in fact assume that our normal vector n is a unit vector, and so the square root term in the equation above is equal to one, then d is simply the shortest distance from the origin to our plane D. So, replacing the terms in our original plane equation, we arrive at the following plane equation:

Although this perhaps doesn’t look as nice as our equation before, it does usefully highlight that there are only 3 independent variables defining our plane. Namely, two orientation components θ and φ, and the distance of the plane from the origin D.

We can then imagine scaling this equation by an arbitrary scaling factor kpl:

Which returns us back to our more general form of the planar equation:

Homogeneous Representation

So, now we’ve established how we can represent planes in Euclidean form, how about in homogeneous form?

Well, as was the case with 2D lines, this connects with the final scalar representations we just discussed. In homogeneous co-ordinates, a plane in 3D space is simply represented as follows:

So, how can we retrieve our Euclidean θ, φ and D terms from this general homogeneous vector? Well, returning to our earlier equation for the origin-to-plane shortest distance D, we can see that:

By comparing this to the homogeneous equation above, it is clear to see that the arbitrary homogeneous scaling factor is given by:

Therefore, in order to transform back to our original θ, φ and D representation, we simply divide all four terms of the homogeneous vector by the L2 distance of the first three terms, and we arrive back at an expression involving just our θ, φ and D terms, which fully defines our 3D plane. Note that this corresponds to the length of the vector normal to the plane, and by dividing by the L2 distance, we are essentially normalizing this vector, and returning it to a unit vector, as we desire for our Euclidean parameterization.

Lines

--

--