Chapter 8

Triangulation

To create a 3D object in CG one assembles its surface, or a good likeness, with help of 2D primitives. For example, the (seemingly 3D) solid ball and torus in Figure 8.1 are depicted by the 2D surface sphere and surface torus which bound them, respectively (note that the calls glutSolidSphere() and glutSolidTorus() in ballAndTorusShadowed.cpp refer to filled triangles, not solid 3D objects). Boris’s head in Figure 8.2 is a mesh of quads.

Figure 8.1:

Figure Showing Screenshot of ballAndTorusShadowed.cpp.

Screenshot of ballAndTorusShadowed.cpp.

Figure 8.2:

Figure Showing Mesh of Boris’s head (courtesy of Sateesh Malla at www.sateeshmalla.com).

Mesh of Boris’s head ...

Get Computer Graphics Through OpenGL, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.