
4.2. Hidden surface drawing and rasteriz a tio n 107
While repeating for all polygons k add the following:
{
Set flag
repeat for all vertices i of polygo n k {
let (X, Y ) be projected coordinates of vertex i
i f X ≥ 0 and X < X
max
{\
clear the flag and jump to next polygon
}
i f Y ≥ 0 and Y < Y
max
{
clear the flag and jump to next polygon
}
}
if the flag is set cull the polygon
}
Listing 4.5: Amendments to the Z buffer algorithm to cull polygons which lie outside
the field of view.
Check scanlin e, i, to see if it is inside the raster.
i f i < 0 or i ≥ Y
max
skip to next scanline
On scanline i polygon k spans pixels x
1
to x
2
.
Before setting p ixel values apply limits to ...