View Full Version : Get Coordinates from Object

12-10-2010, 07:58 AM
Hello Community,
I wrote a little programm in OpenGL, where I have an 3D-Object with specific coordinates from an 3D-Camera. In my OpenGL windows I can rotate, zoom and move this Object, but now I want to display die x,y,&z-coordinate, where my mousecursor is clicking at.
Im new in programming with OpenGL and I have no idea what I have to look for.
At the moment my program shows me the coordinates from the screen but not the 3D-coordinates. I just want to display the values, which i get from the camera for each vertex, which Ive created.

Any Ideas?

P.S:Sorry for my bad english.

12-11-2010, 02:38 AM
You have to unproject your point. See: gluUnProject function.

Look here: http://pyopengl.sourceforge.net/documentation/manual/gluUnProject.3G.html