Lecture: Triangles
Dear students:
The games we play are generally not made of dots and lines. They are made of triangles. Today we start exploring triangles. Thanks to the versatility of vertex buffers, rendering them is not all that different than rendering other primitives. We'll also have a look at interpolating values across a triangle and moving our models around with transformations.
Lost Vertex
We often represent an ngon as a sequence of n
vertices. But what if we lost one of them? Could we recover it? Perhaps if we know something more about the shape. We'll examine several different shapes and see how we might go about repairing them. If we can repair them, we'll build a little renderer that randomly generates broken instances and restores their lost vertex.
Suppose you know that the shape is an equilateral triangle. But you only have its first two vertices as you wind around its perimeter:
Can you compute the third? If so, write down an algorithm.
Silhouette
You read about quilting triangles together to form complex shapes. Let's do a little activity to revisit those ideas. Here's your challenge:
- Draw a polygonal silhouette of some recognizable shape.
- Triangulate it.
- Rough locate its vertex coordinates in \([-1, 1] \times [-1, 1]\).
We'll take the drawing of one lucky student and turn it into a renderer.
Annulus
There are a couple of other big ideas you read about that we should explore together, especially interpolation and transformations. Let's explore them by reverse engineering this scene:

TODO
Here's your list of things to do before we meet next:
See you next time.
Sincerely,