PDA

View Full Version : Near Plane to Far Plane Line Question



superahoy
03-31-2006, 07:53 AM
I want to be able to generate the point on the near plane and the far plane for a given mouse point. What I want is the line / ray generated by a mouse point as it travels from the near clipping plane to the far clipping pane. Does anybody have an example that does this?

def
03-31-2006, 08:14 AM
GluUnProject() is what you are looking for.
Z values of 0.0 will give you the near, and 1.0 will give you the far point you are looking for.

http://www.opengl.org/resources/faq/technical/glu.htm