Login  Register

Re: glDrawElements with TRIANGLE_STRIP

Posted by millerni456 on Sep 28, 2011; 8:53pm
URL: https://forum.jogamp.org/glDrawElements-with-TRIANGLE-STRIP-tp3374872p3377382.html

So... I've had some good luck.

First I changed it to use VBO's

which means in the  glVertexPoint() and glDrawElements() the last parameters were changed to 0 because the buffers were bound by the VBO.

Also I had to change my index loop something like this:

for(int i = 0; i<indices.length; i++)
{
     indices[i] = (short) i; //0, 1, 2, 3, 4, 5, 6, 7....37, 38, 39, 40.
}

Event though I changed this, first off the the logic behind the indices doesn't make sense. Also when rendering, I'm missing 1-2 triangles in the strip. So it is not a closed figure. (I tried tinkering with the indices.length and have not solved the problem).

Any help again is greatly appreciated.