Get dividing out the also called the reciprocal divide
222 Chapter 5 Viewing and Projection
By similar triangles (both have the same angles), we get
| yndc | yv |
|---|---|
| d | =−zv |
| yndc =dyv−zv |
|---|
| axndc | xv |
|---|---|
| d | =−zv |
Solving for xndc:
| xndc =dxv−azv |
|---|
So our final projection transformation equations are
Recall that to transform from RP3to R3we need to divide the other coordi-nates by the w value. If we can set up our matrix to map −zv to our w value, we can take advantage of the homogeneous divide to handle the nonlinear part of our transformation. We can write the situation before the homogeneous divide as a series of linear equations:
x′=d a x
y′= dy
z′= dz
w′= −zLet’s see how this matrix works in practice. If we multiply it by a generic point in view space, we get
|
d/a | 0 | 0 | 0 | | | xv | | dxv/a | ||
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | d | 0 | 0 | yv | dyv | ||||||
| 0 | 0 | d | 0 | zv | dzv | ||||||
| 0 | 0 | −1 | 0 | 1 | −zv |
| xndc =dxv−azv |
|---|


