Glu.UnProject (gb.opengl.glu)

Static Function UnProject ( WindowX As Float, WindowY As Float, WindowZ As Float, Modelview As Float[], Projection As Float[], Viewport As Integer[] ) As Float[]

Map window coordinates to object coordinates.

Parameters

winX, winY, winZ

Specify the window coordinates to be mapped.
model

Specifies the modelview matrix (as from a Gl.GetDoublev call).
proj

Specifies the projection matrix (as from a Gl.GetDoublev call).
view

Specifies the viewport (as from a Gl.GetIntegerv call).
objX, objY, objZ

Returns the computed object coordinates.

Description

Glu.UnProject maps the specified window coordinates into object coordinates using model, proj, and view. The result is stored in objX, objY, and objZ. A return value of Glu.TRUE indicates success; a return value of Glu.FALSE indicates failure.

To compute the coordinates objX objY objZ , Glu.UnProject multiplies the normalized device coordinates by the inverse of model proj as follows:

objX objY objZ W INV P M 2 winX - view 0 view 2 - 1 2 winY - view 1 view 3 - 1 2 winZ - 1 1

INV denotes matrix inversion. W is an unused variable, included for consistent matrix notation.

See also

Glu.Project Gl.Get

See original documentation on OpenGL website