The role of index parameters in glDrawElements with GL_POINTS

What is the role of the index parameter in the glDrawElements function when the mode is set to GL_POINTS? I have the following code:

glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_SHORT, 0, spaceCoordinates); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glTexCoordPointer(3, GL_SHORT, 0, spaceCoordinates); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, gl_rgb_tex); glTexImage2D(GL_TEXTURE_2D, 0, 3, 640, 480, 0, GL_RGB, GL_UNSIGNED_BYTE, globalRGB); glDrawElements(GL_POINTS, 640*480, GL_UNSIGNED_INT, indices); 

where the indices [i] = i; If I do not want the vertex to be drawn, how do I affect indexes?

+4
source share
1 answer

If you do not want some vertices to be drawn, you need to change the count and remove these vertex indices from the indices array.

+3
source

Source: https://habr.com/ru/post/1399419/


All Articles