Page 158 - Computer Graphics Handout
P. 158
4.4.1 Orthogonal Projections
Orthogonal or orthographic projections are a special case of parallel projections, in which the projectors are perpendicular to the
view plane. In terms of a camera, orthogonal projections correspond to a camera with a back plane parallel to the lens, which has
an infinite focal length. Figure 4.21 shows an orthogonal projection with the projection plane z = 0. As points are projected into this
plane, they retain their x and y values, and the equations of projection are
We can write this result using our original homogeneous coordinates:
To prepare ourselves for a more general orthogonal projection, we can write this expression as
q = Mip,
where
I is a 4 × 4 identity matrix, and
The projection described by M is carried out by the hardware after the vertex shader. Hence, only those objects inside the cube of
side length 2 centered at the origin will be projected and possibly visible. If we want to change which objects are visible, we can
replace the identity matrix by a transformation N that we can carry out either in the application or in the vertex shader, which will
give us control over the clipping volume. For example, if we replace I with a scaling matrix, we can see more or fewer
objects.
4.4.2 Parallel Viewing with OpenGL
We will focus on a single orthogonal viewing function in which the view volume is a right parallelepiped, as shown in Figure 4.22.
The sides of the clipping volume are the four planes
x = right ,
x = left ,
y = top,
y = bottom.
The near (front) clipping plane is located a distance near from the origin, and the far (back) clipping plane is at a distance far from
the origin. All these values are in camera coordinates. We will derive a function
mat4 Ortho(Glfloat left, Glfloat right, Glfloat bottom, Glfloat top,
Glfloat near, Glfloat far)
158

