views:

1013

answers:

2

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.

A: 

why does that obviate rendering methods? I'd think the easiest way is to render the polygons to an offscreen buffer with OpenGL.

Jimmy
In my case, the request and the result would need to make many trips to and from the GPU. If the reduced rendering time is sufficient to allow for those trips, then it may be a viable solution.
Sydius
+4  A: 

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 Davis
I got it to work after a minor tweak. Thanks.
Sydius
More than happy to help! Care to explain the minor tweak?
Adam Davis