Contents / Previous / Next


Valid Polygons

Polygons are the areas enclosed by single closed loops of line segments,
where the line segments are specified by the vertices at their endpoints.

In general, polygons can be complicated, so OpenGL makes some strong restrictions on a primitive polygon:

  1. The edges of OpenGL polygons cannot intersect (a mathematician would call this a simple polygon).
  2. Polygons must be convex, they cannot have indentations.
    A region is convex if, given any two points in the interior, the line segment joining them is also in the interior.
  3. Polygons with holes cannot be described.
    They are nonconvex, and they cannot be drawn with a boundary made up of a single closed loop.

[IMAGE]


Be aware that if you present OpenGL with a nonconvex filled polygon,
it might not draw it as you expect (more or less of the convex hull may be filled).

See also:
-> Test if a polygon is concave.