Jump to content
  • Advertisement

Archived

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

dual0

get x,y pos and mouse

This topic is 5456 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
Advertisement
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
thanx, that gave me the the right idea.

see the link, it would explain the job.

http://fly.cc.fer.hr/~unreal/theredbook/chapter12.html

bye

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!