Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good algorithm for drawing solid 2-dimensional polygons?

What is the simplest (and easiest, although that's subjective) algorithm for drawing solid (as in a single, solid color--no texture mapping) 2D polygons in memory? What is the most efficient method?

I am not interested in using the GPU or any rendering method, as the output of my program will not be to the screen.

like image 730
Sydius Avatar asked Dec 10 '08 17:12

Sydius


1 Answers

The Polygon Fill Teaching Tool will show you a very nice, simple algorithm for drawing filled polygons of any complexity.

I've implemented it for embedded graphics, and it's actually a neat (and fun!) algorithm.

-Adam

like image 121
Adam Davis Avatar answered Sep 30 '22 13:09

Adam Davis