Hacker News new | ask | show | jobs
by Figs 2234 days ago
I assume they mean for scanline rendering where you trace two edges at a time while drawing the scanline between them.

Basically, the way it works is that you arrange the 3 vertices of a triangle from top to bottom, then take the middle vertex and split the triangle along the scanline from that vertex to the opposite edge. Each "half" of the triangle can be rendered by simply drawing a scanline between the two edge positions, stepping down to the next line, advancing the two edge positions, and repeating. (See "Bresenham's line algorithm" and "Digital differential analyzer" on wikipedia for efficient ways to compute the edge positions.) Note that if the middle vertex shares a scanline with another vertex, the other "half" of the triangle in this algorithm has a height of zero lines, and can just be ignored.

It's a simple, straightforward way to rasterize a triangle that can be implemented efficiently.