3. Drawing and Transforming Triangles

Chapter Overview:

This chapter builds on those basics by exploring how to draw more complex shapes and

how to manipulate those shapes in 3D space. This chapter looks at: (1) the critical role of

triangles in 3D graphics and WebGL’s support for drawing triangles; (2) using multiple

triangles to draw other basic shapes; (3) basic transformations that move, rotate, and

scale triangles using simple equations; and (4) how matrix operations make transforma-

tions simple.

1. MultiPoint

2. HelloTriangle

3. HelloTriangle_LINES

4. HelloTriangle_LINE_STRIP

5. HelloTriangle_LINE_LOOP

6. HelloQuad

7. HelloQuad_FAN

8. TranslatedTriangle

9. RotatedTriangle

10. RotatedTriangle_Matrix

11. ScaledTriangle_Matrix