I was looking through Lesson 33 because I''m needing mouse support for an OpenGL app that I''m writing.
Pretty much what the app is going to do is display a (real) map section (with real latitude and longitude coordinates), and it''s the program''s job to figure out the latitude and longitude of a point that you click on the map. (You''re given the coords of the corners of the map, and we assume that the Earth is flat.)
The problem lies in how to get the lat and long coords. Using
glRenderMode(GL_SELECT), I can get select the map polygon correctly (albeit, it selects it at the wrong depth). However, I really need to find the 3-D coordinate of the map that I''m given. (a.k.a., if I click on window coord {456, 834}, I get back the OpenGL coord {-60, 158, -100}.)
Looking through the glRenderMode() function, GL_FEEDBACK seems to be the perfect mode as to find out the x and y coordinates clicked on a polygon, given that polygon''s z-coord. However, I haven''t found an example for it, and my co-worker simply wished me "Good luck" after I mentioned GL_FEEDBACK to him.
Is it possible for someone to write me a quick code snippet of how to that? I will treat you as an OpenGL god for the rest of your life. (halfway-j/k)

Thanks in advance,
~ Dragonus