Possible Duplicate:
Rasterizing a 2D polygon
I need to raster a polygon including its inner area (determine all tiles of a grid that lie inside the polygon). Currently I determine the boundary tiles by using a simple Bresenham but I have no efficient way up to now to raster the "inside" of the polygon (which might be concave as well). My approach so far is to limit the tile range to the rectangle including the polygon an then determine for every tile center whether it lies inside or outside using the polygon winding algorithm. This is quit inefficient since it involves checking every polygon boundary segment for every tile. From a first view there should definitely be a faster approach e.g. sth. like winding using the rastered boundary. Is there a standard algorithm which tackles this problem and perhaps even a library implementation in C++ ?
There are quite a few resources on the net, for example:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With