Vertices

What are we drawing? Objects drawn in OpenGL are specified in terms of verticies. This example builds a triangle from three vertices.

119                 // Like any three dimensional polygon, we specify the vertices.
120                 var vertices       = [
121                                               -1.0, -1.0, 0.0,
122                                                1.0, -1.0, 0.0,
123                                                0,    1.0, 0.0
124                                             ];
(0,1) (-1,-1) (1,-1)

Notes

We will be working with a triangle (-1,-1) (1,-1) (0,1). For simplicity we set z=0 to draw a 2-d triangle. We will talk more about the significance of these points later. Each of these points, where the edges of the triangle meet, is called a vertex. You might even remember this from your high school geometry classes. No? Well, it's been a long time for me too.

The vertex is one of the most fundamental concepts in OpenGL, and hence in WebGL, so we will see it a lot.