Original Post
I am learning vertex array now and have a few questions [totally]. Just to make it simple, I created a square patch of 4x4 vertices (or 9 quads). I call glDrawArrays() in GL_POINTS mode to draw the vertices and the vertices turns out OK. I see 16 dots on the screen. Now I am going to turn these dots on the screen to a solid square. I remember people saying that triangle strip is the fastest way to render meshes, but I am not sure how I am going to render a 4x4 square in one call with GL_TRIANGLE_STRIP. The best possible solution I can come up is to render each row/column separately. Or, I can switch to GL_TRIANGLES and render them in one call, but that would mean each vertex is rendered multiple times. This project will eventually turn into a terrain engine. So I am really concerned with the speed. Should I be persistent with GL_TRIANGLE_STRIP or should I go with GL_TRIANGLES? How do people normally render their meshes? edit: I think I got confused with the order the vertices are rendered. Take a look at this illustration:
That's how you normally render triangle strips, right? I have read some tutorials that it would just proceed rendering vertex[0], vertex[1], vertex[2], ... vertex[n]. At the end of the row, you are supposed to go back to the beginning, and "reset" your triangle strip to start with vertex[0] and vertex[12]. You can't just keep going on otherwise a big triangle will cover your entire plane like this:
This is the reason why I come up with rendering each row/colum separately. Tell me I am wrong. I still don't understand how you can render a bunch of vertices with no particular order with triangle strips. [Edited by - alnite on November 18, 2004 8:57:20 PM]
That's how you normally render triangle strips, right? I have read some tutorials that it would just proceed rendering vertex[0], vertex[1], vertex[2], ... vertex[n]. At the end of the row, you are supposed to go back to the beginning, and "reset" your triangle strip to start with vertex[0] and vertex[12]. You can't just keep going on otherwise a big triangle will cover your entire plane like this:
This is the reason why I come up with rendering each row/colum separately. Tell me I am wrong. I still don't understand how you can render a bunch of vertices with no particular order with triangle strips. [Edited by - alnite on November 18, 2004 8:57:20 PM]