Graphics /Build / Filling a triangle
Filling a triangle
goal
You will implement a y-down scanline triangle filler from three vertices. Sort the vertices by y, process the upper range with AB and AC, process the lower range with BC and AC, advance each active edge by its fixed change in x per row, and reuse one horizontal span fill. Your result should match the TriangleTracer row by row: the middle scanline is processed once, left and right come from the current intersections rather than fixed edge names, and flat or degenerate edge cases do not cause division by zero.