Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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????
    Thanks



  • 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