
2.8 API Conventions 137
H
proj, ogl
=
⎡
⎢
⎢
⎢
⎢
⎢
⎢
⎢
⎣
2d
min
r
max
−r
min
000
0
2d
min
u
max
−u
min
0 0
r
max
+r
min
r
max
−r
min
u
max
+u
min
u
max
−u
min
−(d
max
+d
min
)
d
max
−d
min
−1
00
−2d
max
d
min
d
max
−d
min
0
⎤
⎥
⎥
⎥
⎥
⎥
⎥
⎥
⎦
Because of the convention used in the OpenGL view matrix, namely, Q = [RU −D],
the view coordinates are X
view
= (r , u, −d). The application of the projection ma-
trix effectively undoes the sign change on the d-component (and on the D-vector).
OpenGL maps the d-components to the interval [−1, 1], explaining the slightly dif-
ferent terms in the third columns of the matrices H
proj
and H
proj, ogl
.
Once again in my implementations, I avoid the use of Direct3D’s utility functions
D3DXMatrixPerspective* ...