Archived

This topic is now archived and is closed to further replies.

get x,y pos and mouse

This topic is 5153 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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 ?


Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites