title: Building meshes in OpenGL
body: <p>I'm doing some OpenGL (2.1) tests, and while trying to make a simple cube I was wondering how to make complex meshes. For my cube I just set manualy each vertex with <code>GL_TRIANGLES</code>. But I don't know how to make the same inside a loop for example. Because of the order of the vertices and because there are so many repeated vertices!</p>
  
  <p>I really have to make a face by setting 3 vertex "once" (for both triangles)? That seems so slow. How to optimize?</p>
  
  <p><img src="https://i.stack.imgur.com/ISN2V.png" alt="enter image description here"></p>
  
  <p>What are the techniques to make/load meshes?</p>
  
  <p>Oh, I would appreciate some example.</p>