Qt World Summit: Submit your Presentation

Picking a point using OpenGl

  • Hi, I have an application that draws a triangular mesh using OpenGL, and I need to be able to pick up (select) a vertex of the mesh with a mouse click, I mean, I need to know which vertex was clicked.

    Does anyone knows how to do this????

  • OpenGL stuff are draw-only and they don't "reside" nowhere.
    You should have your own "model" of whatever you are drawing and compare a click event to that data instead of the actual drawing.

  • You will need to do some raycasting and detect if the vertex is near the ray.

Log in to reply