I don't have any pictures specifically designed for triangular meshes, since all of my polygon structure is implemented using triangular meshes anyways. Basically in my scene file, you specify the tag: MESH followed by the number of points in the mesh, and then a listing of each point. You then specify the number of normals, and then the number of faces in the mesh. Each face in the mesh consists of a number specifying the number of vertices, and then a list of the vertex reference, followed by a normal reference(if there were any normals defined) I then triangulate the mesh using a simplistic triangulation function, and produce a series of triangles that reference the mesh.
Here is an example of a typical MESH structure in my scene file:
Mesh
4 << The number of points in the Mesh
0.0 0.0 559.2 << The list of points
0.0 0.0 0.0
0.0 548.8 0.0
0.0 548.8 559.2
0 << The number of normals in the Mesh
1 << The number of faces referencing the Mesh
4 << The number of vertices in this face
0 1 2 3 << the vertex references into the list above
I can also specify UV coordinates in the mesh as well. This comes in handy when I want to texture map the polygons. I just need to specify a UV tag after the Mesh tag, then add a UV section after the normal section ( containing the UV's), and then add the appropriate references after the normal reference in the vertex list on each face.
This structure greatly simplifies the building of of scene when using triangles, since it promotes sharing of data. It also saves the amount of memory necessary per triangle, because we are storing 3 unsigned shorts, instead of 3 doubles. (which is a memory savings of approximately 18 bytes per triangle) This memory savings become increasingly apparent once we get into a large number of triangles. ( you do have the overhead still of storing the double precision values, but they are stored in a more centralized location, rather than on a triangle by triangle basis.
Here is the savings for the cornell box that can be seen in many of my images. I've only counted the memory savings of the vertices in this calculation.
* Number of faces: 19
* Number of triangles in the faces: 36
* Storage per triangle w/o meshes: 3 doubles @ 8 bytes each
* Storage per triangle w/ meshes: 3 unsigned shorts @ 2 bytes each
I now reviewed the model, and figured exactly how much storage was used, based on actual sharing of data:
* Calculated storage needed w/o meshes: 36 x 8 x 3= 864 bytes
* Actual storages counted w/ meshes: 724 bytes
So even with the simple cornell box, we have about a 20% savings in the memory used per face.