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>glOrtho</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glOrtho"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glOrtho — multiply the current matrix with an orthographic matrix</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">void <b class="fsfunc">glOrtho</b>(</code></td><td>GLdouble </td><td><var class="pdparam">left</var>, </td></tr><tr><td> </td><td>GLdouble </td><td><var class="pdparam">right</var>, </td></tr><tr><td> </td><td>GLdouble </td><td><var class="pdparam">bottom</var>, </td></tr><tr><td> </td><td>GLdouble </td><td><var class="pdparam">top</var>, </td></tr><tr><td> </td><td>GLdouble </td><td><var class="pdparam">nearVal</var>, </td></tr><tr><td> </td><td>GLdouble </td><td><var class="pdparam">farVal</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>left</code></em>, </span><span class="term"><em class="parameter"><code>right</code></em></span></dt><dd><p> | |
4 | Specify the coordinates for the left and right vertical clipping planes. | |
5 | </p></dd><dt><span class="term"><em class="parameter"><code>bottom</code></em>, </span><span class="term"><em class="parameter"><code>top</code></em></span></dt><dd><p> | |
6 | Specify the coordinates for the bottom and top horizontal clipping planes. | |
7 | </p></dd><dt><span class="term"><em class="parameter"><code>nearVal</code></em>, </span><span class="term"><em class="parameter"><code>farVal</code></em></span></dt><dd><p> | |
8 | Specify the distances to the nearer and farther depth clipping planes. | |
9 | These values are negative if the plane is to be behind the viewer. | |
10 | </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
11 | <code class="function">glOrtho</code> describes a transformation that produces a parallel projection. | |
12 | The current matrix (see <a class="citerefentry" href="glMatrixMode.xml"><span class="citerefentry"><span class="refentrytitle">glMatrixMode</span></span></a>) is multiplied by this matrix | |
13 | and the result replaces the current matrix, as if | |
14 | <a class="citerefentry" href="glMultMatrix.xml"><span class="citerefentry"><span class="refentrytitle">glMultMatrix</span></span></a> were called with the following matrix | |
15 | as its argument: | |
16 | </p><p> | |
17 | </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
18 | ||
19 | <mml:mfenced open="(" close=")"> | |
20 | <mml:mtable> | |
21 | <mml:mtr> | |
22 | <mml:mtd> | |
23 | <mml:mfenced open="" close=""> | |
24 | <mml:mfrac> | |
25 | <mml:mn>2</mml:mn> | |
26 | <mml:mfenced open="" close=""> | |
27 | <mml:mrow> | |
28 | <mml:mi mathvariant="italic">right</mml:mi> | |
29 | <mml:mo>-</mml:mo> | |
30 | <mml:mi mathvariant="italic">left</mml:mi> | |
31 | </mml:mrow> | |
32 | </mml:mfenced> | |
33 | </mml:mfrac> | |
34 | </mml:mfenced> | |
35 | </mml:mtd> | |
36 | <mml:mtd> | |
37 | <mml:mn>0</mml:mn> | |
38 | </mml:mtd> | |
39 | <mml:mtd> | |
40 | <mml:mn>0</mml:mn> | |
41 | </mml:mtd> | |
42 | <mml:mtd> | |
43 | <mml:mfenced open="" close=""> | |
44 | <mml:msub><mml:mi mathvariant="italic">t</mml:mi> | |
45 | <mml:mi mathvariant="italic">x</mml:mi> | |
46 | </mml:msub> | |
47 | </mml:mfenced> | |
48 | </mml:mtd> | |
49 | </mml:mtr> | |
50 | <mml:mtr> | |
51 | <mml:mtd> | |
52 | <mml:mn>0</mml:mn> | |
53 | </mml:mtd> | |
54 | <mml:mtd> | |
55 | <mml:mfenced open="" close=""> | |
56 | <mml:mfrac> | |
57 | <mml:mn>2</mml:mn> | |
58 | <mml:mfenced open="" close=""> | |
59 | <mml:mrow> | |
60 | <mml:mi mathvariant="italic">top</mml:mi> | |
61 | <mml:mo>-</mml:mo> | |
62 | <mml:mi mathvariant="italic">bottom</mml:mi> | |
63 | </mml:mrow> | |
64 | </mml:mfenced> | |
65 | </mml:mfrac> | |
66 | </mml:mfenced> | |
67 | </mml:mtd> | |
68 | <mml:mtd> | |
69 | <mml:mn>0</mml:mn> | |
70 | </mml:mtd> | |
71 | <mml:mtd> | |
72 | <mml:mfenced open="" close=""> | |
73 | <mml:msub><mml:mi mathvariant="italic">t</mml:mi> | |
74 | <mml:mi mathvariant="italic">y</mml:mi> | |
75 | </mml:msub> | |
76 | </mml:mfenced> | |
77 | </mml:mtd> | |
78 | </mml:mtr> | |
79 | <mml:mtr> | |
80 | <mml:mtd> | |
81 | <mml:mn>0</mml:mn> | |
82 | </mml:mtd> | |
83 | <mml:mtd> | |
84 | <mml:mn>0</mml:mn> | |
85 | </mml:mtd> | |
86 | <mml:mtd> | |
87 | <mml:mfenced open="" close=""> | |
88 | <mml:mfrac> | |
89 | <mml:mn>-2</mml:mn> | |
90 | <mml:mfenced open="" close=""> | |
91 | <mml:mrow> | |
92 | <mml:mi mathvariant="italic">farVal</mml:mi> | |
93 | <mml:mo>-</mml:mo> | |
94 | <mml:mi mathvariant="italic">nearVal</mml:mi> | |
95 | </mml:mrow> | |
96 | </mml:mfenced> | |
97 | </mml:mfrac> | |
98 | </mml:mfenced> | |
99 | </mml:mtd> | |
100 | <mml:mtd> | |
101 | <mml:mfenced open="" close=""> | |
102 | <mml:msub><mml:mi mathvariant="italic">t</mml:mi> | |
103 | <mml:mi mathvariant="italic">z</mml:mi> | |
104 | </mml:msub> | |
105 | </mml:mfenced> | |
106 | </mml:mtd> | |
107 | </mml:mtr> | |
108 | <mml:mtr> | |
109 | <mml:mtd> | |
110 | <mml:mn>0</mml:mn> | |
111 | </mml:mtd> | |
112 | <mml:mtd> | |
113 | <mml:mn>0</mml:mn> | |
114 | </mml:mtd> | |
115 | <mml:mtd> | |
116 | <mml:mn>0</mml:mn> | |
117 | </mml:mtd> | |
118 | <mml:mtd> | |
119 | <mml:mn>1</mml:mn> | |
120 | </mml:mtd> | |
121 | </mml:mtr> | |
122 | </mml:mtable> | |
123 | </mml:mfenced> | |
124 | </mml:math></div><p> | |
125 | </p><p> | |
126 | where | |
127 | </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
128 | ||
129 | <mml:mrow> | |
130 | <mml:msub><mml:mi mathvariant="italic">t</mml:mi> | |
131 | <mml:mi mathvariant="italic">x</mml:mi> | |
132 | </mml:msub> | |
133 | <mml:mo>=</mml:mo> | |
134 | <mml:mrow> | |
135 | <mml:mo>-</mml:mo> | |
136 | <mml:mfenced open="" close=""> | |
137 | <mml:mfrac> | |
138 | <mml:mfenced open="" close=""> | |
139 | <mml:mrow> | |
140 | <mml:mi mathvariant="italic">right</mml:mi> | |
141 | <mml:mo>+</mml:mo> | |
142 | <mml:mi mathvariant="italic">left</mml:mi> | |
143 | </mml:mrow> | |
144 | </mml:mfenced> | |
145 | <mml:mfenced open="" close=""> | |
146 | <mml:mrow> | |
147 | <mml:mi mathvariant="italic">right</mml:mi> | |
148 | <mml:mo>-</mml:mo> | |
149 | <mml:mi mathvariant="italic">left</mml:mi> | |
150 | </mml:mrow> | |
151 | </mml:mfenced> | |
152 | </mml:mfrac> | |
153 | </mml:mfenced> | |
154 | </mml:mrow> | |
155 | </mml:mrow> | |
156 | </mml:math></div><p> | |
157 | </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
158 | ||
159 | <mml:mrow> | |
160 | <mml:msub><mml:mi mathvariant="italic">t</mml:mi> | |
161 | <mml:mi mathvariant="italic">y</mml:mi> | |
162 | </mml:msub> | |
163 | <mml:mo>=</mml:mo> | |
164 | <mml:mrow> | |
165 | <mml:mo>-</mml:mo> | |
166 | <mml:mfenced open="" close=""> | |
167 | <mml:mfrac> | |
168 | <mml:mfenced open="" close=""> | |
169 | <mml:mrow> | |
170 | <mml:mi mathvariant="italic">top</mml:mi> | |
171 | <mml:mo>+</mml:mo> | |
172 | <mml:mi mathvariant="italic">bottom</mml:mi> | |
173 | </mml:mrow> | |
174 | </mml:mfenced> | |
175 | <mml:mfenced open="" close=""> | |
176 | <mml:mrow> | |
177 | <mml:mi mathvariant="italic">top</mml:mi> | |
178 | <mml:mo>-</mml:mo> | |
179 | <mml:mi mathvariant="italic">bottom</mml:mi> | |
180 | </mml:mrow> | |
181 | </mml:mfenced> | |
182 | </mml:mfrac> | |
183 | </mml:mfenced> | |
184 | </mml:mrow> | |
185 | </mml:mrow> | |
186 | </mml:math></div><p> | |
187 | </p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
188 | ||
189 | <mml:mrow> | |
190 | <mml:msub><mml:mi mathvariant="italic">t</mml:mi> | |
191 | <mml:mi mathvariant="italic">z</mml:mi> | |
192 | </mml:msub> | |
193 | <mml:mo>=</mml:mo> | |
194 | <mml:mrow> | |
195 | <mml:mo>-</mml:mo> | |
196 | <mml:mfenced open="" close=""> | |
197 | <mml:mfrac> | |
198 | <mml:mfenced open="" close=""> | |
199 | <mml:mrow> | |
200 | <mml:mi mathvariant="italic">farVal</mml:mi> | |
201 | <mml:mo>+</mml:mo> | |
202 | <mml:mi mathvariant="italic">nearVal</mml:mi> | |
203 | </mml:mrow> | |
204 | </mml:mfenced> | |
205 | <mml:mfenced open="" close=""> | |
206 | <mml:mrow> | |
207 | <mml:mi mathvariant="italic">farVal</mml:mi> | |
208 | <mml:mo>-</mml:mo> | |
209 | <mml:mi mathvariant="italic">nearVal</mml:mi> | |
210 | </mml:mrow> | |
211 | </mml:mfenced> | |
212 | </mml:mfrac> | |
213 | </mml:mfenced> | |
214 | </mml:mrow> | |
215 | </mml:mrow> | |
216 | </mml:math></div><p> | |
217 | </p><p> | |
218 | Typically, the matrix mode is <code class="constant">GL_PROJECTION</code>, and | |
219 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
220 | ||
221 | <mml:mfenced open="(" close=")"> | |
222 | <mml:mi mathvariant="italic">left</mml:mi> | |
223 | <mml:mi mathvariant="italic">bottom</mml:mi> | |
224 | <mml:mrow> | |
225 | <mml:mo>-</mml:mo> | |
226 | <mml:mi mathvariant="italic">nearVal</mml:mi> | |
227 | </mml:mrow> | |
228 | </mml:mfenced> | |
229 | </mml:math> | |
230 | and | |
231 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
232 | ||
233 | <mml:mfenced open="(" close=")"> | |
234 | <mml:mi mathvariant="italic">right</mml:mi> | |
235 | <mml:mi mathvariant="italic">top</mml:mi> | |
236 | <mml:mrow> | |
237 | <mml:mo>-</mml:mo> | |
238 | <mml:mi mathvariant="italic">nearVal</mml:mi> | |
239 | </mml:mrow> | |
240 | </mml:mfenced> | |
241 | </mml:math> | |
242 | specify the points on the near clipping plane that are mapped | |
243 | to the lower left and upper right corners of the window, | |
244 | respectively, | |
245 | assuming that the eye is located at (0, 0, 0). | |
246 | <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"> | |
247 | ||
248 | <mml:mrow> | |
249 | <mml:mo>-</mml:mo> | |
250 | <mml:mi mathvariant="italic">farVal</mml:mi> | |
251 | </mml:mrow> | |
252 | </mml:math> | |
253 | specifies the location of the far clipping plane. | |
254 | Both <em class="parameter"><code>nearVal</code></em> and <em class="parameter"><code>farVal</code></em> can be either positive or negative. | |
255 | </p><p> | |
256 | Use <a class="citerefentry" href="glPushMatrix.xml"><span class="citerefentry"><span class="refentrytitle">glPushMatrix</span></span></a> and <a class="citerefentry" href="glPopMatrix.xml"><span class="citerefentry"><span class="refentrytitle">glPopMatrix</span></span></a> to save and restore | |
257 | the current matrix stack. | |
258 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
259 | <code class="constant">GL_INVALID_VALUE</code> is generated if | |
260 | <em class="parameter"><code>left</code></em> = <em class="parameter"><code>right</code></em>, or | |
261 | <em class="parameter"><code>bottom</code></em> = <em class="parameter"><code>top</code></em>, or | |
262 | <em class="parameter"><code>near</code></em> = <em class="parameter"><code>far</code></em>. | |
263 | </p><p> | |
264 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glOrtho</code> | |
265 | is executed between the execution of | |
266 | <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> | |
267 | and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
268 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p> | |
269 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_MATRIX_MODE</code> | |
270 | </p><p> | |
271 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_COLOR_MATRIX</code> | |
272 | </p><p> | |
273 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_MODELVIEW_MATRIX</code> | |
274 | </p><p> | |
275 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PROJECTION_MATRIX</code> | |
276 | </p><p> | |
277 | <a class="citerefentry" href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_TEXTURE_MATRIX</code> | |
278 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p> | |
279 | <a class="citerefentry" href="glFrustum.xml"><span class="citerefentry"><span class="refentrytitle">glFrustum</span></span></a>, | |
280 | <a class="citerefentry" href="glMatrixMode.xml"><span class="citerefentry"><span class="refentrytitle">glMatrixMode</span></span></a>, | |
281 | <a class="citerefentry" href="glMultMatrix.xml"><span class="citerefentry"><span class="refentrytitle">glMultMatrix</span></span></a>, | |
282 | <a class="citerefentry" href="glPushMatrix.xml"><span class="citerefentry"><span class="refentrytitle">glPushMatrix</span></span></a>, | |
283 | <a class="citerefentry" href="glViewport.xml"><span class="citerefentry"><span class="refentrytitle">glViewport</span></span></a> | |
284 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
285 | Copyright <span class="trademark"></span>© 1991-2006 | |
286 | Silicon Graphics, Inc. This document is licensed under the SGI | |
287 | Free Software B License. For details, see | |
288 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
289 | </p></div></div></body></html> |