PDA

View Full Version : convert window coordinates to OpenGL coordinates



grodslukaren
07-02-2001, 09:44 AM
How can I do to convert my coordinates I get from the mouse into the coordinates used in my OpenGL window...

I want to add objects to another object at the point I define with a mouse click, but in an environment where one can rotate the object where I add my second object.

It works fine to convert the coordinates if I donīt rotate the first object, but if I rotate, everything goes wrong (naturaly)

Thanks in advance!!

/grodslukaren

DFrey
07-02-2001, 10:30 AM
Read up on gluUnproject. It is expressly for the purpose of converting window coordinates to object coordinates.