Picking a point using OpenGl
-
wrote on 1 Sept 2011, 13:35 last edited by
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 -
wrote on 2 Sept 2011, 09:48 last edited by
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. -
wrote on 2 Sept 2011, 10:30 last edited by
You will need to do some raycasting and detect if the vertex is near the ray.
1/3