Subject 3.10: How do I quickly draw a filled triangle?
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, I’ll tell you 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.