title: Correct Way to Texture Square Made of Two Triangles?
body: <p>I using OpenGL 4.1 and GLSL 410. I am attempting to texture a square that I made using the following coordinates:</p>
  
  <pre><code>float points[] = {
      -0.5,  0.5,
      -0.5, -0.5,
       0.5, -0.5,
      -0.5,  0.5,
       0.5, -0.5,
       0.5,  0.5
  };
  </code></pre>
  
  <p>I draw the square like this:</p>
  
  <pre><code>glDrawArrays (GL_TRIANGLES, 0, 6);
  </code></pre>
  
  <p>From all of the tutorials I have read, the author uses an element buffer to draw the square or has just four vertices. This means that all the tutorials I have read have texture coordinates that line up with each vertex. For me, I'm using 6 vertices, so I'm not sure how to line up the texture coordinates.</p>
  
  <p>Would coordinates like this work for my case:</p>
  
  <pre><code>float texcoords[] = {
      0.0, 1.0,
      0.0, 0.0,
      1.0, 0.0,
      0.0, 1.0,
      1.0, 0.0,
      1.0, 1.0
  };
  </code></pre>
  
  <p>I've done lots of reading, but haven't come across anyone else who is using six vertices like I am.</p>
  
  <p>Would my texture coordinates work and if not, what is the best way to come up with texture coordinates.</p>