Painter’s algorithm
Algorithm:
- Apply projection transform to all polygons.
- Sort all polygons by z, splitting intersecting polygons along z.
- Scan convert polygons in back to front order.
- Polgons that are closer overwrite those that are further away.
Drawbacks: requires sorting and splits; pixels are overwritten many times.
Front to back version: add a bit to pixel to indicate it was written.