   Draw/find the area of an irregular polygon
  I am working on a 2d game engine in opengl, and when I was testing it out a little while ago, I noticed I couldn't draw some shapes correctly due to using GL_TRIANGLE_FAN to draw my objects, and using a similar method of this to find the area of my polygons.How should I adjust my drawing/area finding methods to work on objects like this:(black area is object if that is a bit confusing)I have no idea how to approach this. Thanks in advance.   
  The area-finding is very easy to get to work. You simply have to make sure that you use a notion of area of a triangle with sign indicating orientation. For instance, you can measure the area of a triangle as half of the determinant|x1 y1 1||x2 y2 1||x3 y3 1|If you do that, the area of the polygon will turn out to be correctly computed even if it is concave.Drawing concave polygons is significantly harder. You can try an ear-clipping algorithm, or perhaps use a library (e.g., GPC or CGAL) to decompose your polygon into convex pieces.;  Thanks! Everything you mentioned is working nicely.   ;Quote:Original post by alvaroDrawing concave polygons is significantly harder. You can try an ear-clipping algorithm, or perhaps use a library (e.g., GPC or CGAL) to decompose your polygon into convex pieces.Actually, you can use the same signed area trick to draw them too; this makes drawing concave polygons very easy; see here.  Of course, this comes at a cost of fillrate.   ;Quote:Original post by EmergentActually, you can use the same signed area trick to draw them too; this makes drawing concave polygons very easy; see here.  Of course, this comes at a cost of fillrate.Oh, yes. I had seen that before, and I should have remembered.   