Getting mouse coordinates

Started by
5 comments, last by SomePerson 20 years, 2 months ago
I want to be able to select objects using the mouse and opengl. I know there is a way with i think glaux. I want to know if there is another way (that is easy?)? Does anyone know? Please Help! thank you!
Advertisement
One way is to use the GetCursorPos() to get the mouse coordinates, and adding some more code to your LRESULT CALLBACK WindowProc() that would handle events such as WM_LBUTTONDOWN (if you need that kind of control).

HTH
---You're not your CPU, or your graphics card, you're not your RAM...
if you wanna get your 3d mouse coordinates do a search for gluunproject()
How who i turn my screen coordinate into 3d space to select stuff like polygons?

what is gluunproject() ?

umm.. okay i added this after the fact. I looked up gluUnProject() on MSDN. I tell me what to supply but not how to use it. Does anyone know how?

[edited by - someperson on February 7, 2004 11:03:45 AM]
WM_MOUSEMOVE ?
If you want to select objects with your mouse, it would probably be better to use picking. NeHe has a tutorial on picking and object selection, and so does GameTutorials. Check them out!

[edited by - JonahB on February 7, 2004 7:04:12 PM]
Thanks but i have seen that. and the tutorials didn''t seen verty helpful. Maybe ill read over them again....

This topic is closed to new replies.

Advertisement