2/13/2008

How to transform from mouse click point to 3d world.

I study way to transform from mouse click point in the screen coordinate to virtual 3d world coordinate.

Of course, use OpenGL.

I googled key words,catched usefull API.

It's glReadPixels and glUnProject, To use glReadPixels with specified GL_DEPTH_COMPONENT format gives me depth value, and depth value and x,y in screen coordinate transform to 3d world coordinate by calling glUnProject.

No comments: