View Full Version : Extracting points from GL_QAUD

18th January 2010, 12:17
Dear Friends
I have created a mesh(grid) using opengl's GL_QUAD option using glDrawElements() check below the code

GLuint list = glGenLists(1);
glNewList(list, GL_COMPILE);
glVertexPointer(2, GL_FLOAT, 0, vertices);
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
glNewList(list, GL_COMPILE);
glDrawElements(GL_QUADS, ptsInBlock*ptsInBlock*blocks*4, GL_UNSIGNED_INT, indices);

Now I can see the elements on the screen. I want to do some operations on these elements so I need the information about each of these elements, i.e, I need the all 4 points coordinates for each of these elements.How can I retrive each element and all points coordinates.

Any idea would be highly appreciated.[/B]

19th January 2010, 22:38
If you want the coordinates of the points before they are projected on the screen, grab a copy of the "vertices"-array. If you want the projected coordinates on the screen, see http://nehe.gamedev.net/data/articles/article.asp?article=13