Drawing geometry
So far, we've seen how to set up our OpenGL renderer and draw some very basic geometry. But, as you can imagine, we can do a lot more with OpenGL. In this section we'll see how to do some more complex operations and how to load geometry defined using an external tool. Sometimes, it might come in useful to define the geometry using code, but most of the time, and especially if the geometry is very complex, it'll be designed and created using a 3D modeling tool. Knowing how we can import that geometry will definitely come in very handy for our projects.
Adding volume
In our previous example, we've seen how to draw a quad with one single color, but what about if each vertex has a completely different color? The process will not be very different from what we've already done, but let's see how we can do it.
First, let's change the color array to hold the color of the four vertices:
float color[] = { 1.0f, 0.2f, 0.2f, 1.0f, 0.2f, 1.0f, 0.2f, 1.0f, 0.2f...