
102 4. Basic visualization
Figure 4.7: Scanline fill by stroking the rows of the output raster.
Line 1
Line 0
Line 2
(x
0
, y
0
)
(x
1
, y
1
)
(x
2
, y
2
)
x
y
Scanline i
Figure 4.8: Scanline filling a t r ia n g u la r polygon.
This is the most useful filling procedure for a 3D p oly gon r en d er in g al-
gorithm because it works very efficiently for simple convex shapes. The
drawing stage in a large number of rendering algorithms is commonly per-
formed with triangles because a triangle is the simp les t polygon and it is
also planar. All triangles are convex. Quadrilaterals are easily divided into
two tr ian gles and higher order polygons are rare. In any case it