un Project
Un-projects a screen coordinate point to Cartesian coordinates at the near clip plane and the far clip plane. This method assumes this matrix represents an inverse modelview-projection matrix. The result of this method is undefined if this matrix is not an inverse modelview-projection matrix.
The screen point is understood to be in OpenGL screen coordinates, with the origin in the bottom-left corner and axes that extend up and to the right from the origin.
This function stores the un-projected points in the result argument, and a boolean value indicating whether the un-projection is successful.
Return
true if the transformation is successful, otherwise false
Parameters
the screen point's X component
the screen point's Y component
the viewport defining the screen point's coordinate system
a pre-allocated Vec3 in which to return the un-projected near clip plane point
a pre-allocated Vec3 in which to return the un-projected far clip plane point
Un-projects a screen coordinate point at a given normalized depth to Cartesian coordinates. This method assumes this matrix represents an inverse modelview-projection matrix; the result is undefined otherwise.
The screen point is in OpenGL screen coordinates (origin at the bottom-left). The depth value is the normalized depth-buffer value in [0, 1] as read from the depth buffer at the screen point.
Return
true if the un-projection is successful, otherwise false
Parameters
the screen point's X component
the screen point's Y component
the normalized depth value in [0, 1]
the viewport defining the screen point's coordinate system
a pre-allocated Vec3 in which to return the un-projected Cartesian point