Search code examples
openglperspectivecamera

Camera Space OpenGL Tutorial


I'm following the tutorial at http://alfonse.bitbucket.org/oldtut/Positioning/Tut04%20Perspective%20Projection.html which I believe the user, Nicol Bolas, is the author. Under the Camera Perspective topic, I am getting stuck.

"Our perspective projection transform will be specific to this space. As previously stated, the projection plane shall be a region [-1, 1] in the X and Y axes, and at a Z value of -1. The projection will be from vertices in the -Z direction onto this plane; vertices that have a positive Z value are behind the projection plane.

Now, we will make one more simplifying assumption: the location of the center of the perspective plane is fixed at (0, 0, -1) in camera space. Therefore, since the projection plane is pointing down the -Z axis, eye's location relative to the plane of projection is (0, 0, -1). Thus, the Ez value, the offset from the projection plane to the eye, is always -1. This means that our perspective term, when phrased as division rather than multiplication, is simply Pz/-1: the negation of the camera-space Z coordinate."

Isn't the eye's location relative to the plane of projection a positive 1 in the z direction?

My understanding is the eye is at (0,0,0) and the plane's center is at (0,0,-1). Relatively, the eye is +1 in the z direction to the plane.

I was doing really well understanding this tutorial with this exception. I can even look past it and understand the rest of the tutorial while just believing this, but that's not what I want to do.


Solution

  • Therefore, since the projection plane is pointing down the -Z axis, eye's location relative to the plane of projection is (0, 0, -1).

    It's probably best to pretend that this sentence doesn't exist. In fact, it doesn't exist. I defy you to prove me wrong.

    No fair looking at the Bitbucket repo either ;)