View Full Version : Getting screen coordinates
11-24-2004, 02:38 PM
I am having problems relating the screen dimensions (GLfloats) to what the mouse is reporting for position. I can tell the origin is in the middle of the screen, but how do you the the active bounds for the floats? I have tried glGetDoublev(GL_VIEWPORT, dVal), but it returns the same information the mouse reports. Any suggestions?
I believe you should take a look at gluUnproject.
Given viewport, modelview, projection matrices etc. it gives you back the point you clicked from window coordinates to world coordinates. For the opposite I think it's gluProject. Try finding the examples of the aforementioned function in the Red Book (OpenGL Programming Guide)
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.