I am trying to draw with DrawRangeElements
function, but for some reasons it don't draw part of elements.
For example, I have 156 points. My each element contains 52 points (3 elements x 52 points = 156 points).
Consider such code:
//points contains 156 points
float[] points = new float[] {
1f, 2f, 3f, // 0
//......... //refers to first element
4f, 5f, 5f, //51
6f, 7f, 8f, //52
//......... //refers to second element
9f, 10f, 11f, //103
6f, 7f, 8f, //104
//......... //refers to third element
9f, 10f, 11f, //155
};
With DrawElements everything works fine.
var indices1 = Enumerable.Range(0, 52).Select(i => (uint)i).ToArray();
var indices2 = Enumerable.Range(52, 52).Select(i => (uint)i).ToArray();
var indices3 = Enumerable.Range(104, 52).Select(i => (uint)i).ToArray();
GL.DrawElements(PrimitiveType.QuadStrip, 52, DrawElementsType.UnsignedInt, indices1);
GL.DrawElements(PrimitiveType.QuadStrip, 52, DrawElementsType.UnsignedInt, indices2);
GL.DrawElements(PrimitiveType.QuadStrip, 52, DrawElementsType.UnsignedInt, indices3);
But for DrawRangeElements my effors fails. Only one from three elements is drawing.
var indices = Enumerable.Range(0, 156).Select(i => (uint)i).ToArray();
GL.DrawRangeElements(PrimitiveType.QuadStrip, 0, 51, 52, DrawElementsType.UnsignedInt, indices);
GL.DrawRangeElements(PrimitiveType.QuadStrip, 52, 103, 52, DrawElementsType.UnsignedInt, indices);
GL.DrawRangeElements(PrimitiveType.QuadStrip, 104, 155, 52, DrawElementsType.UnsignedInt, indices);
How, with DrawRangeElements
I can draw my 3 elements?