1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glRasterPos">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glRasterPos
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glRasterPos
</refname>
17 <refpurpose>specify the raster position for pixel operations
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glRasterPos2s
</function></funcdef>
23 <paramdef>GLshort
<parameter>x
</parameter></paramdef>
24 <paramdef>GLshort
<parameter>y
</parameter></paramdef>
29 <funcdef>void
<function>glRasterPos2i
</function></funcdef>
30 <paramdef>GLint
<parameter>x
</parameter></paramdef>
31 <paramdef>GLint
<parameter>y
</parameter></paramdef>
36 <funcdef>void
<function>glRasterPos2f
</function></funcdef>
37 <paramdef>GLfloat
<parameter>x
</parameter></paramdef>
38 <paramdef>GLfloat
<parameter>y
</parameter></paramdef>
43 <funcdef>void
<function>glRasterPos2d
</function></funcdef>
44 <paramdef>GLdouble
<parameter>x
</parameter></paramdef>
45 <paramdef>GLdouble
<parameter>y
</parameter></paramdef>
50 <funcdef>void
<function>glRasterPos3s
</function></funcdef>
51 <paramdef>GLshort
<parameter>x
</parameter></paramdef>
52 <paramdef>GLshort
<parameter>y
</parameter></paramdef>
53 <paramdef>GLshort
<parameter>z
</parameter></paramdef>
58 <funcdef>void
<function>glRasterPos3i
</function></funcdef>
59 <paramdef>GLint
<parameter>x
</parameter></paramdef>
60 <paramdef>GLint
<parameter>y
</parameter></paramdef>
61 <paramdef>GLint
<parameter>z
</parameter></paramdef>
66 <funcdef>void
<function>glRasterPos3f
</function></funcdef>
67 <paramdef>GLfloat
<parameter>x
</parameter></paramdef>
68 <paramdef>GLfloat
<parameter>y
</parameter></paramdef>
69 <paramdef>GLfloat
<parameter>z
</parameter></paramdef>
74 <funcdef>void
<function>glRasterPos3d
</function></funcdef>
75 <paramdef>GLdouble
<parameter>x
</parameter></paramdef>
76 <paramdef>GLdouble
<parameter>y
</parameter></paramdef>
77 <paramdef>GLdouble
<parameter>z
</parameter></paramdef>
82 <funcdef>void
<function>glRasterPos4s
</function></funcdef>
83 <paramdef>GLshort
<parameter>x
</parameter></paramdef>
84 <paramdef>GLshort
<parameter>y
</parameter></paramdef>
85 <paramdef>GLshort
<parameter>z
</parameter></paramdef>
86 <paramdef>GLshort
<parameter>w
</parameter></paramdef>
91 <funcdef>void
<function>glRasterPos4i
</function></funcdef>
92 <paramdef>GLint
<parameter>x
</parameter></paramdef>
93 <paramdef>GLint
<parameter>y
</parameter></paramdef>
94 <paramdef>GLint
<parameter>z
</parameter></paramdef>
95 <paramdef>GLint
<parameter>w
</parameter></paramdef>
100 <funcdef>void
<function>glRasterPos4f
</function></funcdef>
101 <paramdef>GLfloat
<parameter>x
</parameter></paramdef>
102 <paramdef>GLfloat
<parameter>y
</parameter></paramdef>
103 <paramdef>GLfloat
<parameter>z
</parameter></paramdef>
104 <paramdef>GLfloat
<parameter>w
</parameter></paramdef>
109 <funcdef>void
<function>glRasterPos4d
</function></funcdef>
110 <paramdef>GLdouble
<parameter>x
</parameter></paramdef>
111 <paramdef>GLdouble
<parameter>y
</parameter></paramdef>
112 <paramdef>GLdouble
<parameter>z
</parameter></paramdef>
113 <paramdef>GLdouble
<parameter>w
</parameter></paramdef>
117 <!-- eqn: ignoring delim $$ -->
118 <refsect1 id=
"parameters"><title>Parameters
</title>
121 <term><parameter>x
</parameter></term>
122 <term><parameter>y
</parameter></term>
123 <term><parameter>z
</parameter></term>
124 <term><parameter>w
</parameter></term>
128 <inlineequation><mml:math><mml:mi mathvariant=
"italic">x
</mml:mi></mml:math></inlineequation>,
129 <inlineequation><mml:math><mml:mi mathvariant=
"italic">y
</mml:mi></mml:math></inlineequation>,
130 <inlineequation><mml:math><mml:mi mathvariant=
"italic">z
</mml:mi></mml:math></inlineequation>,
132 <inlineequation><mml:math><mml:mi mathvariant=
"italic">w
</mml:mi></mml:math></inlineequation>
142 <refsynopsisdiv><title>C Specification
</title>
145 <funcdef>void
<function>glRasterPos2sv
</function></funcdef>
146 <paramdef>const GLshort *
<parameter>v
</parameter></paramdef>
151 <funcdef>void
<function>glRasterPos2iv
</function></funcdef>
152 <paramdef>const GLint *
<parameter>v
</parameter></paramdef>
157 <funcdef>void
<function>glRasterPos2fv
</function></funcdef>
158 <paramdef>const GLfloat *
<parameter>v
</parameter></paramdef>
163 <funcdef>void
<function>glRasterPos2dv
</function></funcdef>
164 <paramdef>const GLdouble *
<parameter>v
</parameter></paramdef>
169 <funcdef>void
<function>glRasterPos3sv
</function></funcdef>
170 <paramdef>const GLshort *
<parameter>v
</parameter></paramdef>
175 <funcdef>void
<function>glRasterPos3iv
</function></funcdef>
176 <paramdef>const GLint *
<parameter>v
</parameter></paramdef>
181 <funcdef>void
<function>glRasterPos3fv
</function></funcdef>
182 <paramdef>const GLfloat *
<parameter>v
</parameter></paramdef>
187 <funcdef>void
<function>glRasterPos3dv
</function></funcdef>
188 <paramdef>const GLdouble *
<parameter>v
</parameter></paramdef>
193 <funcdef>void
<function>glRasterPos4sv
</function></funcdef>
194 <paramdef>const GLshort *
<parameter>v
</parameter></paramdef>
199 <funcdef>void
<function>glRasterPos4iv
</function></funcdef>
200 <paramdef>const GLint *
<parameter>v
</parameter></paramdef>
205 <funcdef>void
<function>glRasterPos4fv
</function></funcdef>
206 <paramdef>const GLfloat *
<parameter>v
</parameter></paramdef>
211 <funcdef>void
<function>glRasterPos4dv
</function></funcdef>
212 <paramdef>const GLdouble *
<parameter>v
</parameter></paramdef>
216 <refsect1 id=
"parameters2"><title>Parameters
</title>
219 <term><parameter>v
</parameter></term>
222 Specifies a pointer to an array of two,
226 <inlineequation><mml:math><mml:mi mathvariant=
"italic">x
</mml:mi></mml:math></inlineequation>,
227 <inlineequation><mml:math><mml:mi mathvariant=
"italic">y
</mml:mi></mml:math></inlineequation>,
228 <inlineequation><mml:math><mml:mi mathvariant=
"italic">z
</mml:mi></mml:math></inlineequation>,
230 <inlineequation><mml:math><mml:mi mathvariant=
"italic">w
</mml:mi></mml:math></inlineequation>
231 coordinates, respectively.
237 <refsect1 id=
"description"><title>Description
</title>
239 The GL maintains a
3D position in window coordinates.
241 called the raster position,
242 is used to position pixel and bitmap write operations. It is
243 maintained with subpixel accuracy.
244 See
<citerefentry><refentrytitle>glBitmap
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawPixels
</refentrytitle></citerefentry>, and
<citerefentry><refentrytitle>glCopyPixels
</refentrytitle></citerefentry>.
247 The current raster position consists of three window coordinates
248 (
<inlineequation><mml:math><mml:mi mathvariant=
"italic">x
</mml:mi></mml:math></inlineequation>,
249 <inlineequation><mml:math><mml:mi mathvariant=
"italic">y
</mml:mi></mml:math></inlineequation>,
250 <inlineequation><mml:math><mml:mi mathvariant=
"italic">z
</mml:mi></mml:math></inlineequation>),
251 a clip coordinate value
252 (
<inlineequation><mml:math><mml:mi mathvariant=
"italic">w
</mml:mi></mml:math></inlineequation>),
253 an eye coordinate distance,
255 and associated color data and texture coordinates.
257 <inlineequation><mml:math><mml:mi mathvariant=
"italic">w
</mml:mi></mml:math></inlineequation>
258 coordinate is a clip coordinate,
260 <inlineequation><mml:math><mml:mi mathvariant=
"italic">w
</mml:mi></mml:math></inlineequation>
261 is not projected to window coordinates.
262 <function>glRasterPos4
</function> specifies object coordinates
263 <inlineequation><mml:math><mml:mi mathvariant=
"italic">x
</mml:mi></mml:math></inlineequation>,
264 <inlineequation><mml:math><mml:mi mathvariant=
"italic">y
</mml:mi></mml:math></inlineequation>,
265 <inlineequation><mml:math><mml:mi mathvariant=
"italic">z
</mml:mi></mml:math></inlineequation>,
267 <inlineequation><mml:math><mml:mi mathvariant=
"italic">w
</mml:mi></mml:math></inlineequation>
269 <function>glRasterPos3
</function> specifies object coordinate
270 <inlineequation><mml:math><mml:mi mathvariant=
"italic">x
</mml:mi></mml:math></inlineequation>,
271 <inlineequation><mml:math><mml:mi mathvariant=
"italic">y
</mml:mi></mml:math></inlineequation>,
273 <inlineequation><mml:math><mml:mi mathvariant=
"italic">z
</mml:mi></mml:math></inlineequation>
276 <inlineequation><mml:math><mml:mi mathvariant=
"italic">w
</mml:mi></mml:math></inlineequation>
277 is implicitly set to
1.
278 <function>glRasterPos2
</function> uses the argument values for
279 <inlineequation><mml:math><mml:mi mathvariant=
"italic">x
</mml:mi></mml:math></inlineequation>
281 <inlineequation><mml:math><mml:mi mathvariant=
"italic">y
</mml:mi></mml:math></inlineequation>
284 <inlineequation><mml:math><mml:mi mathvariant=
"italic">z
</mml:mi></mml:math></inlineequation>
286 <inlineequation><mml:math><mml:mi mathvariant=
"italic">w
</mml:mi></mml:math></inlineequation>
290 The object coordinates presented by
<function>glRasterPos
</function> are treated just like those
291 of a
<citerefentry><refentrytitle>glVertex
</refentrytitle></citerefentry> command:
292 They are transformed by the current modelview and projection matrices
293 and passed to the clipping stage.
294 If the vertex is not culled,
295 then it is projected and scaled to window coordinates,
296 which become the new current raster position,
297 and the
<constant>GL_CURRENT_RASTER_POSITION_VALID
</constant> flag is set.
299 <emphasis>is
</emphasis>
301 then the valid bit is cleared and the current raster position
302 and associated color and texture coordinates are undefined.
305 The current raster position also includes some associated color data
306 and texture coordinates.
307 If lighting is enabled,
308 then
<constant>GL_CURRENT_RASTER_COLOR
</constant>
310 or
<constant>GL_CURRENT_RASTER_INDEX
</constant>
311 (in color index mode)
312 is set to the color produced by the lighting calculation
313 (see
<citerefentry><refentrytitle>glLight
</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLightModel
</refentrytitle></citerefentry>, and
314 <citerefentry><refentrytitle>glShadeModel
</refentrytitle></citerefentry>).
315 If lighting is disabled,
317 (in RGBA mode, state variable
<constant>GL_CURRENT_COLOR
</constant>)
319 (in color index mode, state variable
<constant>GL_CURRENT_INDEX
</constant>)
320 is used to update the current raster color.
321 <constant>GL_CURRENT_RASTER_SECONDARY_COLOR
</constant> (in RGBA mode) is likewise updated.
325 <constant>GL_CURRENT_RASTER_TEXTURE_COORDS
</constant> is updated as a function
326 of
<constant>GL_CURRENT_TEXTURE_COORDS
</constant>,
327 based on the texture matrix and the texture generation functions
328 (see
<citerefentry><refentrytitle>glTexGen
</refentrytitle></citerefentry>).
330 the distance from the origin of the eye coordinate system to the
331 vertex as transformed by only the modelview matrix replaces
332 <constant>GL_CURRENT_RASTER_DISTANCE
</constant>.
335 Initially, the current raster position is (
0,
0,
0,
1),
336 the current raster distance is
0,
337 the valid bit is set,
338 the associated RGBA color is (
1,
1,
1,
1),
339 the associated color index is
1,
340 and the associated texture coordinates are (
0,
0,
0,
1).
342 <constant>GL_CURRENT_RASTER_INDEX
</constant> is always
1;
344 the current raster RGBA color always maintains its initial value.
347 <refsect1 id=
"notes"><title>Notes
</title>
349 The raster position is modified by
<function>glRasterPos
</function>,
<citerefentry><refentrytitle>glBitmap
</refentrytitle></citerefentry>, and
<citerefentry><refentrytitle>glWindowPos
</refentrytitle></citerefentry>.
352 When the raster position coordinates are invalid,
353 drawing commands that are based on the raster position are
354 ignored (that is, they do not result in changes to GL state).
357 Calling
<citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry> or
<citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry> may leave the
358 current color or index indeterminate.
359 If
<function>glRasterPos
</function> is executed while the current color or index is indeterminate, the
360 current raster color or current raster index remains indeterminate.
363 To set a valid raster position outside the viewport, first set a valid
364 raster position, then call
<citerefentry><refentrytitle>glBitmap
</refentrytitle></citerefentry> with NULL as the
<emphasis>bitmap
</emphasis>
368 When the
<code>ARB_imaging
</code> extension is supported, there are distinct
369 raster texture coordinates for each texture unit. Each texture unit's
370 current raster texture coordinates are updated by
<function>glRasterPos
</function>.
373 <refsect1 id=
"errors"><title>Errors
</title>
375 <constant>GL_INVALID_OPERATION
</constant> is generated if
<function>glRasterPos
</function>
376 is executed between the execution of
<citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
377 and the corresponding execution of
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>.
380 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
382 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_CURRENT_RASTER_POSITION
</constant>
385 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_CURRENT_RASTER_POSITION_VALID
</constant>
388 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_CURRENT_RASTER_DISTANCE
</constant>
391 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_CURRENT_RASTER_COLOR
</constant>
394 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_CURRENT_RASTER_SECONDARY_COLOR
</constant>
397 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_CURRENT_RASTER_INDEX
</constant>
400 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_CURRENT_RASTER_TEXTURE_COORDS
</constant>
403 <refsect1 id=
"seealso"><title>See Also
</title>
405 <citerefentry><refentrytitle>glBitmap
</refentrytitle></citerefentry>,
406 <citerefentry><refentrytitle>glCopyPixels
</refentrytitle></citerefentry>,
407 <citerefentry><refentrytitle>glDrawArrays
</refentrytitle></citerefentry>,
408 <citerefentry><refentrytitle>glDrawElements
</refentrytitle></citerefentry>,
409 <citerefentry><refentrytitle>glDrawRangeElements
</refentrytitle></citerefentry>,
410 <citerefentry><refentrytitle>glDrawPixels
</refentrytitle></citerefentry>,
411 <citerefentry><refentrytitle>glMultiTexCoord
</refentrytitle></citerefentry>,
412 <citerefentry><refentrytitle>glTexCoord
</refentrytitle></citerefentry>,
413 <citerefentry><refentrytitle>glTexGen
</refentrytitle></citerefentry>,
414 <citerefentry><refentrytitle>glVertex
</refentrytitle></citerefentry>,
415 <citerefentry><refentrytitle>glWindowPos
</refentrytitle></citerefentry>
418 <refsect1 id=
"Copyright"><title>Copyright
</title>
420 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
421 Silicon Graphics, Inc. This document is licensed under the SGI
422 Free Software B License. For details, see
423 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.