I found this post, which is sort of answering my question, but not completely:
How to drag the line segment by selecting the vertex
What I am trying to resolve: a modern way (using OpenGL 4 architecture) of performing vertex selection:
- a user draws a selection (rubber band, that's not what I am after)
- I assume at this stage I can give some sort of unique ID to each vertex in the model
- the selected region is somehow re-rendered, off-line using some sort of vertex/fragment shader that would store the vertices in a buffer that I could read back?
I am just guessing it involves some sort of buffer in which the shaders can write the result of the rendered vertices in, buffer which is readable in the program. I wonder if someone has done that already or could at least orient me in the right direction. It needs to be (ideally) fast (working on very large models), and use OpenGL4 (no deprecated features such as GL_SELECT, etc.).
- ideally, I'd also need to use the same technique to select other components such as edges and faces.