page #1 (ptl, dda) page #2 (tri) page #3 (grd, dth) page #4 (3d) page #5 (buf) page #6 (idx) scratches |
perspective projection
w = tan(90 / 2 * PI / 180) // = 1
x = x * w
y = y * w
z = z * w
perspective divide
x = x / z
y = y / z
screen space transform
x = (x + 0.5) * w
y = (y + 0.5) * h