Appendix A. Linear Interpolation of 1/z

We will now discuss why, with central projection, we can use linear interpolation of 1/z, called zi in Chapter 7, and not simply z. For example, with two points P1(x1, y1, zi1 and P2(x2, y2, zi2), where x1, y1, x2 and y2 are logical screen coordinates, while zi1 = 1/z1 and zi2 = 1/z2, we can compute similar coordinates of the midpoint M(xM, yM, ziM) by using

xM = 0.5 (x1 + x2)
yM = 0.5 (y1 + y2)
ziM = 0.5(zi1 + zi2)

In general we have

Linear Interpolation of 1/z

Figure A.1 shows the eye-coordinate axes x and z and the screen z = −d. For simplicity, we ignore the y-axis. Recall that the position E of the eye is the origin of this coordinate system and that the negative z-axis points towards the center of the object. Point P lies on line l, which has the following equation:

Equation A.1. 

Linear Interpolation of 1/z

The ray of light PE intersects the screen in P′(x′, −d). Then all points (x, z) of this ray of light satisfy the equation

Linear Interpolation of 1/z

or

Linear Interpolation of 1/z

To compute the point of intersection of this ray of light and line l, we substitute this result in (A.1), finding

Dividing the left- and right-hand sides of this equation ...

Get Computer Graphics for Java Programmers, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.