1GLUUNPROJECT(3G)                                              GLUUNPROJECT(3G)
2
3
4

NAME

6       gluUnProject - map window coordinates to object coordinates
7
8

C SPECIFICATION

10       GLint gluUnProject( GLdouble winX,
11                           GLdouble winY,
12                           GLdouble winZ,
13                           const GLdouble *model,
14                           const GLdouble *proj,
15                           const GLint *view,
16                           GLdouble* objX,
17                           GLdouble* objY,
18                           GLdouble* objZ )
19
20

PARAMETERS

22       winX, winY, winZ
23                       Specify the window coordinates to be mapped.
24
25       model           Specifies  the modelview matrix (as from a glGetDoublev
26                       call).
27
28       proj            Specifies the projection matrix (as from a glGetDoublev
29                       call).
30
31       view            Specifies the viewport (as from a glGetIntegerv call).
32
33       objX, objY, objZ
34                       Returns the computed object coordinates.
35

DESCRIPTION

37       gluUnProject  maps the specified window coordinates into object coordi‐
38       nates using model, proj, and view.  The result is stored in objX, objY,
39       and  objZ.  A return value of GL_TRUE indicates success; a return value
40       of GL_FALSE indicates failure.
41
42       To compute the coordinates (objX, objY, and objZ), gluUnProject  multi‐
43       plies the normalized device coordinates by the inverse of model*proj as
44       follows:
45
46
47                           objX
48                          ⎛⎝objY⎞⎠=INV(PM)⎛⎝2_(_w_i_nv_Xi_−e_vw_i[_e2_w]_[_0_]_)_−1⎞⎠
49                           objZ          2_(_w_i_nv_Yi_−e_vw_i[_e3_w]_[_1_]_)_−1
50                            W                2(winZ)−1
51                                                 1
52       INV() denotes matrix inversion.  W is an unused variable, included  for
53       consistent matrix notation.
54

SEE ALSO

56       glGet(3G), gluProject(3G)
57
58
59
60                                                              GLUUNPROJECT(3G)
Impressum