Polygon Meshes

You should break your polygon into triangle, because if you don't, your API will do it for you in a way that could not suits you (triangle renderer are implemented in hardware, especially when using gouraud shading)

The polygons we can represent can be arbitrarily large, both in terms of the number of vertices and the area. It is generally convenient and more appropriate to use a polygon mesh rather than a single mammoth polygon.

For example, you can simplify the process of rendering polygons by breaking all polygons into triangles. Then your triangle renderer from project two would be powerful enough to render every polygon. Triangle renderers can also be implemented in hardware, making it advantageous to break the world down into triangles.

Another example where smaller polygons are better is the Gouraud lighting model. Gouraud computes lighting at vertices and interpolates the values in the interiors of the polygons. By breaking larger surfaces into meshes of smaller polygons, the lighting approximation is improved.

Whenever you can, use Triangle strip, Triangle Fan, Quad Strip

Triangle mesh produces n-2 triangles from a polygon of n vertices.

Triangle list will produce only a n/3 triangles

Quadrilateral mesh produces (n-1) by (m-1) quadrilaterals from an n x m array of vertices.

Not co-planar polygon

Specifying polygons with more than three vertices could result in sets of points which are not co-planar! There are two ways to solve this problem:

  • Break the polygon into triangles, and deal

  • Approximate A, B, and C in the plane equation.

    • Averaging
    • Projecting the polygon onto the coordinate planes.
  • A should be proportional to the projection in the yz-plane, B proportional to xz, and C proportional to xy.