1GLUUNPROJECT4(3G) GLUUNPROJECT4(3G)
2
3
4
6 gluUnProject4 - map window and clip coordinates to object coordinates
7
8
10 GLint gluUnProject4( GLdouble winX,
11 GLdouble winY,
12 GLdouble winZ,
13 GLdouble clipW,
14 const GLdouble *model,
15 const GLdouble *proj,
16 const GLint *view,
17 GLdouble near,
18 GLdouble far,
19 GLdouble* objX,
20 GLdouble* objY,
21 GLdouble* objZ,
22 GLdouble* objW )
23
24
26 winX, winY, winZ
27 Specify the window coordinates to be mapped.
28
29 clipW Specify the clip w coordinate to be mapped.
30
31 model Specifies the modelview matrix (as from a glGetDoublev
32 call).
33
34 proj Specifies the projection matrix (as from a glGetDoublev
35 call).
36
37 view Specifies the viewport (as from a glGetIntegerv call).
38
39 near, far Specifies the near and far planes (as from a glGetDou‐
40 blev call).
41
42 objX, objY, objZ, objW
43 Returns the computed object coordinates.
44
46 gluUnProject4 maps the specified window coordinates winX, winY and winZ
47 and its clip w coordinate clipW into object coordinates (objX, objY,
48 objZ, objW) using model, proj and view. clipW can be other than 1 as
49 for vertices in glFeedbackBuffer when data type GL_4D_COLOR_TEXTURE is
50 returned. This also handles the case where the near and far planes are
51 different from the default, 0 and 1, respectively. A return value of
52 GL_TRUE indicates success; a return value of GL_FALSE indicates fail‐
53 ure.
54
55 To compute the coordinates (objX, objY, objZ and objW), gluUnProject4
56 multiplies the normalized device coordinates by the inverse of
57 model*proj as follows:
58
59
60 objX
61 ⎛⎝objY⎞⎠=INV(PM)⎛⎝2_(_w_i_nv_Xi_−e_vw_i[_e2_w]_[_0_]_)_−1⎞⎠
62 objZ 2_(_w_i_nv_Yi_−e_vw_i[_e3_w]_[_1_]_)_−1
63 objW 2_((_wf_ia_nr_Z−_−n_ne_ea_ar_r)_)_−1
64 clipW
65 INV() denotes matrix inversion.
66
67 gluUnProject4 is equivalent to gluUnProject when clipW is 1, near is 0
68 and far is 1.
69
71 gluUnProject4 is available only if the GLU version is 1.3 or greater.
72
74 glGet(3G), glFeedbackBuffer(3G), gluProject(3G), gluUnProject(3G)
75
76
77
78 GLUUNPROJECT4(3G)