Hey all, I broke my picking by putting placing vertex arrays in my project and now trying to figure out how to do this w/ vertex arrays.
I have a wire frame mesh and I’m trying to have each element of my mesh highlighted by hovering the mouse over that triangle. I think my problem is that I’m using vertex arrays. I set the vertex arrays up just as soon as my application reads in an input file, parses the coord values, and loads them into vertex arrays.
I think I need to call glLoadName(int) for each drawing command (each triangle) while on the MODELVIEW matrix during render mode SELECT so that I can process the hits. But I don’t know how since all my triangles are now one big vertex array where I then make a call like the following to draw them.
gl.glVertexPointer(3, GL.GL_FLOAT, 0, vElementsBuffer[index]);
gl.glDrawArrays(GL.GL_TRIANGLES, 0, vElementsBuffer[index].capacity() / 3);
Is there a way to assign a name to each triangle when using vertex arrays? Does that make sense? Any help much appreciated.