get x,y pos and mouse
Hello
I draw an object with tha classic
glRotate(...)
glTransate(...)
glBegin(...)
glVertex(..vert1.)
glVertex(..vert2.)
...
glEnd(...)
I want to get x,y pos ver1 to use with mouse func and determine when it is clicked, how can I do taht?
thanx
huela
If you''re developing in windows, you can respond to the window events WM_MOUSEMOVE and WM_MOUSEDOWN...
Check the MSDN for more info...
Check the MSDN for more info...
I''am developing under linux, but this was not my question.
I''am able to capture mouse coords with glutMouseFunc(), that give me x,y.
But now I want to determinate witch object I''have fired to?
How can I determinate if mouse (x,y) coords are corrensponding with opengl my object ?
I''am able to capture mouse coords with glutMouseFunc(), that give me x,y.
But now I want to determinate witch object I''have fired to?
How can I determinate if mouse (x,y) coords are corrensponding with opengl my object ?
huela
I''ve never actually done it, but the book I just read called "OpenGL, a Primer" by Edward Angel has a section on it. Basically you have to re-render the scene in a special selection mode which allows you to collect hits for a particular clipping region which corresponds to a rectangle around the mouse. Sorry I don''t have more specifics, but maybe this will point you in the right direction.
-sam
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement