Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> |
2 | <!-- saved from url=(0013)about:internet --> | |
3 | <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>gluUnProject</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="gluUnProject"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>gluUnProject — map window coordinates to object coordinates</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">GLint <b class="fsfunc">gluUnProject</b>(</code></td><td>GLdouble </td><td><var class="pdparam">winX</var>, </td></tr><tr><td> </td><td>GLdouble </td><td><var class="pdparam">winY</var>, </td></tr><tr><td> </td><td>GLdouble </td><td><var class="pdparam">winZ</var>, </td></tr><tr><td> </td><td>const GLdouble * </td><td><var class="pdparam">model</var>, </td></tr><tr><td> </td><td>const GLdouble * </td><td><var class="pdparam">proj</var>, </td></tr><tr><td> </td><td>const GLint * </td><td><var class="pdparam">view</var>, </td></tr><tr><td> </td><td>GLdouble* </td><td><var class="pdparam">objX</var>, </td></tr><tr><td> </td><td>GLdouble* </td><td><var class="pdparam">objY</var>, </td></tr><tr><td> </td><td>GLdouble* </td><td><var class="pdparam">objZ</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>winX</code></em>, </span><span class="term"><em class="parameter"><code>winY</code></em>, </span><span class="term"><em class="parameter"><code>winZ</code></em></span></dt><dd><p> | |
4 | Specify the window coordinates to be mapped. | |
5 | </p></dd><dt><span class="term"><em class="parameter"><code>model</code></em></span></dt><dd><p> | |
6 | Specifies the modelview matrix (as from a <a class="citerefentry" href="glGetDoublev.xml"><span class="citerefentry"><span class="refentrytitle">glGetDoublev</span></span></a> call). | |
7 | </p></dd><dt><span class="term"><em class="parameter"><code>proj</code></em></span></dt><dd><p> | |
8 | Specifies the projection matrix (as from a <a class="citerefentry" href="glGetDoublev.xml"><span class="citerefentry"><span class="refentrytitle">glGetDoublev</span></span></a> call). | |
9 | </p></dd><dt><span class="term"><em class="parameter"><code>view</code></em></span></dt><dd><p> | |
10 | Specifies the viewport (as from a <a class="citerefentry" href="glGetIntegerv.xml"><span class="citerefentry"><span class="refentrytitle">glGetIntegerv</span></span></a> call). | |
11 | </p></dd><dt><span class="term"><em class="parameter"><code>objX</code></em>, </span><span class="term"><em class="parameter"><code>objY</code></em>, </span><span class="term"><em class="parameter"><code>objZ</code></em></span></dt><dd><p> | |
12 | Returns the computed object coordinates. | |
13 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
14 | <code class="function">gluUnProject</code> maps the specified window coordinates into object | |
15 | coordinates using <em class="parameter"><code>model</code></em>, <em class="parameter"><code>proj</code></em>, and <em class="parameter"><code>view</code></em>. | |
16 | The result is stored in <em class="parameter"><code>objX</code></em>, <em class="parameter"><code>objY</code></em>, and <em class="parameter"><code>objZ</code></em>. A return value of | |
17 | <code class="constant">GLU_TRUE</code> indicates success; a return value of <code class="constant">GLU_FALSE</code> | |
18 | indicates failure. | |
19 | </p><p> | |
20 | To compute the coordinates | |
21 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
22 | ||
23 | <mml:mfenced open="(" close=")"> | |
24 | <mml:mi mathvariant="italic">objX</mml:mi> | |
25 | <mml:mi mathvariant="italic">objY</mml:mi> | |
26 | <mml:mi mathvariant="italic">objZ</mml:mi> | |
27 | </mml:mfenced> | |
28 | </mml:math>, | |
29 | <code class="function">gluUnProject</code> multiplies the normalized device coordinates by the inverse of | |
30 | <em class="parameter"><code>model</code></em> * <em class="parameter"><code>proj</code></em> as follows: | |
31 | </p><p> | |
32 | </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
33 | ||
34 | <mml:mrow> | |
35 | <mml:mfenced open="(" close=")"> | |
36 | <mml:mtable> | |
37 | <mml:mtr><mml:mtd> | |
38 | <mml:mi mathvariant="italic">objX</mml:mi> | |
39 | </mml:mtd></mml:mtr> | |
40 | <mml:mtr><mml:mtd> | |
41 | <mml:mi mathvariant="italic">objY</mml:mi> | |
42 | </mml:mtd></mml:mtr> | |
43 | <mml:mtr><mml:mtd> | |
44 | <mml:mi mathvariant="italic">objZ</mml:mi> | |
45 | </mml:mtd></mml:mtr> | |
46 | <mml:mtr><mml:mtd> | |
47 | <mml:mi mathvariant="italic">W</mml:mi> | |
48 | </mml:mtd></mml:mtr> | |
49 | </mml:mtable> | |
50 | </mml:mfenced> | |
51 | <mml:mo>=</mml:mo> | |
52 | <mml:mrow> | |
53 | <mml:mrow> | |
54 | <mml:mi mathvariant="italic">INV</mml:mi> | |
55 | <mml:mo></mml:mo> | |
56 | <mml:mfenced open="(" close=")"> | |
57 | <mml:mrow> | |
58 | <mml:mi mathvariant="italic">P</mml:mi> | |
59 | <mml:mo></mml:mo> | |
60 | <mml:mi mathvariant="italic">M</mml:mi> | |
61 | </mml:mrow> | |
62 | </mml:mfenced> | |
63 | </mml:mrow> | |
64 | <mml:mo></mml:mo> | |
65 | <mml:mfenced open="(" close=")"> | |
66 | <mml:mtable> | |
67 | <mml:mtr><mml:mtd> | |
68 | <mml:mrow> | |
69 | <mml:mfrac> | |
70 | <mml:mfenced open="" close=""> | |
71 | <mml:mrow> | |
72 | <mml:mn>2</mml:mn> | |
73 | <mml:mo></mml:mo> | |
74 | <mml:mfenced open="(" close=")"> | |
75 | <mml:mrow> | |
76 | <mml:mi mathvariant="italic">winX</mml:mi> | |
77 | <mml:mo>-</mml:mo> | |
78 | <mml:mrow> | |
79 | <mml:mi mathvariant="italic">view</mml:mi> | |
80 | <mml:mo></mml:mo> | |
81 | <mml:mfenced open="[" close="]"> | |
82 | <mml:mn>0</mml:mn> | |
83 | </mml:mfenced> | |
84 | </mml:mrow> | |
85 | </mml:mrow> | |
86 | </mml:mfenced> | |
87 | </mml:mrow> | |
88 | </mml:mfenced> | |
89 | <mml:mfenced open="" close=""> | |
90 | <mml:mrow> | |
91 | <mml:mi mathvariant="italic">view</mml:mi> | |
92 | <mml:mo></mml:mo> | |
93 | <mml:mfenced open="[" close="]"> | |
94 | <mml:mn>2</mml:mn> | |
95 | </mml:mfenced> | |
96 | </mml:mrow> | |
97 | </mml:mfenced> | |
98 | </mml:mfrac> | |
99 | <mml:mo>-</mml:mo> | |
100 | <mml:mn>1</mml:mn> | |
101 | </mml:mrow> | |
102 | </mml:mtd></mml:mtr> | |
103 | <mml:mtr><mml:mtd> | |
104 | <mml:mrow> | |
105 | <mml:mfrac> | |
106 | <mml:mfenced open="" close=""> | |
107 | <mml:mrow> | |
108 | <mml:mn>2</mml:mn> | |
109 | <mml:mo></mml:mo> | |
110 | <mml:mfenced open="(" close=")"> | |
111 | <mml:mrow> | |
112 | <mml:mi mathvariant="italic">winY</mml:mi> | |
113 | <mml:mo>-</mml:mo> | |
114 | <mml:mrow> | |
115 | <mml:mi mathvariant="italic">view</mml:mi> | |
116 | <mml:mo></mml:mo> | |
117 | <mml:mfenced open="[" close="]"> | |
118 | <mml:mn>1</mml:mn> | |
119 | </mml:mfenced> | |
120 | </mml:mrow> | |
121 | </mml:mrow> | |
122 | </mml:mfenced> | |
123 | </mml:mrow> | |
124 | </mml:mfenced> | |
125 | <mml:mfenced open="" close=""> | |
126 | <mml:mrow> | |
127 | <mml:mi mathvariant="italic">view</mml:mi> | |
128 | <mml:mo></mml:mo> | |
129 | <mml:mfenced open="[" close="]"> | |
130 | <mml:mn>3</mml:mn> | |
131 | </mml:mfenced> | |
132 | </mml:mrow> | |
133 | </mml:mfenced> | |
134 | </mml:mfrac> | |
135 | <mml:mo>-</mml:mo> | |
136 | <mml:mn>1</mml:mn> | |
137 | </mml:mrow> | |
138 | </mml:mtd></mml:mtr> | |
139 | <mml:mtr><mml:mtd> | |
140 | <mml:mrow> | |
141 | <mml:mrow> | |
142 | <mml:mn>2</mml:mn> | |
143 | <mml:mo></mml:mo> | |
144 | <mml:mfenced open="(" close=")"> | |
145 | <mml:mi mathvariant="italic">winZ</mml:mi> | |
146 | </mml:mfenced> | |
147 | </mml:mrow> | |
148 | <mml:mo>-</mml:mo> | |
149 | <mml:mn>1</mml:mn> | |
150 | </mml:mrow> | |
151 | </mml:mtd></mml:mtr> | |
152 | <mml:mtr><mml:mtd> | |
153 | <mml:mn>1</mml:mn> | |
154 | </mml:mtd></mml:mtr> | |
155 | </mml:mtable> | |
156 | </mml:mfenced> | |
157 | </mml:mrow> | |
158 | </mml:mrow> | |
159 | </mml:math></div><p> | |
160 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mi mathvariant="italic">INV</mml:mi></mml:math> | |
161 | denotes matrix inversion. | |
162 | W is an unused variable, included for consistent matrix notation. | |
163 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
164 | <a class="citerefentry" href="gluProject.xml"><span class="citerefentry"><span class="refentrytitle">gluProject</span></span></a>, | |
165 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> | |
166 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
167 | Copyright <span class="trademark"></span>© 1991-2006 | |
168 | Silicon Graphics, Inc. This document is licensed under the SGI | |
169 | Free Software B License. For details, see | |
170 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
171 | </p></div></div></body></html> |