• Advertisement
Sign in to follow this  

Problem with cursor position

This topic is 3995 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 everyone, I wrote this thread also in the openGL form. I think that also this form may help. If double threads are problem sorry. The mod can delete this thread. My problem is with getting the cursor position. I draw a quad with all vertex have a z value 0.25 and othe vertex values are (-1.0,-1.0) to (0.0,0.0). But when I click on the object I get cursor values (0 to 640, 0 to 480) which means the actual screen position. So a hit never happens when I try to make a selection. What can I do to solve this problem. PS : I use C#/CsGL and tried to understand the 32nd tutorial which is about selections. Thanks in advance and best regards.

Share this post


Link to post
Share on other sites
Advertisement
There are several ways to achieve picking, on the one hand you could use the method of picking described in the NeHe tutorials, but what you intend to do seems more like you want to transform screen coordinates (what you have for your mouse) to world space (your quad).
The latter one can be achieved by using gluUnproject (just google for it or take a look at http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/glu/unproject.html)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement