title: OpenGL render only a part of VBOs
body: <p>I have a VBO with a IBO and I want to render for example the second triangle and in the next render step I want to render the third triangle.</p>
  
  <p>I think the correct way to render the second triangle ist to call</p>
  
  <pre><code>glDrawArrays(GL_TRIANGLES, 
               3,  // indexArray[3] is start
               3); // take 3 indices (from index 3..5 --&gt; second triangle)
  </code></pre>
  
  <p>It works fine with the first triangle. But when I want to render another triangle the parameters of the VBO will be interpreted not correctly.</p>
  
  <p>The definition of my VAO looks like this</p>
  
  <pre><code>glGenVertexArrays(1, out VAO);
  glBindVertexArray(VAO);
  glBindBuffer(GL_ARRAY_BUFFER, VBO.V_ID);
  glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, VBO.E_ID);
  
  glEnableVertexAttribArray(0);
  glVertexAttribPointer(0, 2, GL_FLOAT, false, 12 * sizeof(float), 0);
  glBindAttribLocation(shaderID, 0, "InUV");
  glEnableVertexAttribArray(1);
  glVertexAttribPointer(1, 4, GL_FLOAT, true, 12 * sizeof(float), 2 * sizeof(float));
  glBindAttribLocation(shaderID, 1, "InColor");
  glEnableVertexAttribArray(2);
  glVertexAttribPointer(2, 3, GL_FLOAT, true, 12 * sizeof(float), 6 * sizeof(float));
  glBindAttribLocation(shaderID, 2, "InNormal");
  glEnableVertexAttribArray(3);
  glVertexAttribPointer(3, 3, GL_FLOAT, false, 12 * sizeof(float), 9 * sizeof(float));
  glBindAttribLocation(shaderID, 3, "InVertex");
  
  glBindVertexArray(0);
  </code></pre>
  
  <p>When I call </p>
  
  <pre><code>glDrawElements(GL_TRIANGLES, VBO.length, GL_UNSIGNED_INT, 0);
  </code></pre>
  
  <p>The object will render correctly.</p>
  
  <p>Does I use glDrawArrays in a wrong way or is there another way to render one special triangle of a VBO???</p>