Triangle Scan Conversion
From CGAFaq
The easiest way is to render each line separately into an edge buffer. This buffer is a structure which looks like this (in C):
struct { int xmin, xmax; } edgebuffer[YDIM];
There is one entry for each scan line on the screen, and each entry is to be interpreted as a horizontal line to be drawn from xmin to xmax.
Since most people who ask this question are trying to write fast games on the PC, here’s where to find code. Look at:
- ftp::/ftp.uwp.edu/pub/msdos/demos/programming/source
- ftp::/ftp.luth.se/pub/msdos/demos (Sweden)
- ftp::/NCTUCCCA.edu.tw:/PC/uwp/demos
- http://www.wit.com:/mirrors/uwp/pub/msdos/demos
- ftp::/ftp.cdrom.com:/demos
Detailed and accurate explanations (including texture mapping) can be found in "Perspective Texture Mapping" articles (Chris Hecker - GDMag) here: http://www.d6.com/users/checker/misctech.htm

