Game Engine Architecture

(Ben Green) #1

436 10. The Rendering Engine


10.1.4.4. Projection and Homogeneous Clip Space
Both perspective and orthographic projections transform points in view space
into a coordinate space called homogeneous clip space. This three-dimensional
space is really just a warped version of view space. The purpose of clip space
is to convert the camera-space view volume into a canonical view volume that
is independent both of the kind of projection used to convert the 3D scene into
2D screen space, and of the resolution and aspect ratio of the screen onto which
the scene is going to be rendered.
In clip space, the canonical view volume is a rectangular prism extending
from –1 to +1 along the x- and y-axes. Along the z-axis, the view volume ex-
tends either from –1 to +1 (OpenGL) or from 0 to 1 (DirectX). We call this coor-

Figure 10.33. An orthographic view volume.

Far
yV Plane

Near
Plane

xV

zV

(r, b, n)

(r, b, f)

(r, t, f)

(l, t, f)

(l, b, n)

(l, t, n)

(l, b, f)

(r, t, n)

PlaneFar

yH

PlaneNear
xH

zH

(1, –1, –1)

( 1, – 1, 1 )

(1 , 1, 1)

(–1 , 1, 1)

(–1, –1, –1)

( –1, 1, – 1)

Figure 10.34. The canonical view volume in homogeneous clip space.
Free download pdf