xenocara/doc/gl-docs/GL/gl/rasterpos.3gl
2006-11-29 17:00:35 +00:00

288 lines
7.6 KiB
Plaintext

.\" $XFree86$
'\" e
'\"! eqn | mmdoc
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp Jan 14 18:30
.ds Dm 01 rasterpos
.ds Xs 20383 7 rasterpos.gl
.TH GLRASTERPOS 3G
.SH NAME
.B "glRasterPos2d, glRasterPos2f, glRasterPos2i, glRasterPos2s, glRasterPos3d, glRasterPos3f, glRasterPos3i, glRasterPos3s, glRasterPos4d, glRasterPos4f, glRasterPos4i, glRasterPos4s, glRasterPos2dv, glRasterPos2fv, glRasterPos2iv, glRasterPos2sv, glRasterPos3dv, glRasterPos3fv, glRasterPos3iv, glRasterPos3sv, glRasterPos4dv, glRasterPos4fv, glRasterPos4iv, glRasterPos4sv
\- specify the raster position for pixel operations
.SH C SPECIFICATION
void \f3glRasterPos2d\fP(
GLdouble \fIx\fP,
.nf
.ta \w'\f3void \fPglRasterPos2d( 'u
GLdouble \fIy\fP )
.fi
void \f3glRasterPos2f\fP(
GLfloat \fIx\fP,
.nf
.ta \w'\f3void \fPglRasterPos2f( 'u
GLfloat \fIy\fP )
.fi
void \f3glRasterPos2i\fP(
GLint \fIx\fP,
.nf
.ta \w'\f3void \fPglRasterPos2i( 'u
GLint \fIy\fP )
.fi
void \f3glRasterPos2s\fP(
GLshort \fIx\fP,
.nf
.ta \w'\f3void \fPglRasterPos2s( 'u
GLshort \fIy\fP )
.fi
void \f3glRasterPos3d\fP(
GLdouble \fIx\fP,
.nf
.ta \w'\f3void \fPglRasterPos3d( 'u
GLdouble \fIy\fP,
GLdouble \fIz\fP )
.fi
void \f3glRasterPos3f\fP(
GLfloat \fIx\fP,
.nf
.ta \w'\f3void \fPglRasterPos3f( 'u
GLfloat \fIy\fP,
GLfloat \fIz\fP )
.fi
void \f3glRasterPos3i\fP(
GLint \fIx\fP,
.nf
.ta \w'\f3void \fPglRasterPos3i( 'u
GLint \fIy\fP,
GLint \fIz\fP )
.fi
void \f3glRasterPos3s\fP(
GLshort \fIx\fP,
.nf
.ta \w'\f3void \fPglRasterPos3s( 'u
GLshort \fIy\fP,
GLshort \fIz\fP )
.fi
void \f3glRasterPos4d\fP(
GLdouble \fIx\fP,
.nf
.ta \w'\f3void \fPglRasterPos4d( 'u
GLdouble \fIy\fP,
GLdouble \fIz\fP,
GLdouble \fIw\fP )
.fi
void \f3glRasterPos4f\fP(
GLfloat \fIx\fP,
.nf
.ta \w'\f3void \fPglRasterPos4f( 'u
GLfloat \fIy\fP,
GLfloat \fIz\fP,
GLfloat \fIw\fP )
.fi
void \f3glRasterPos4i\fP(
GLint \fIx\fP,
.nf
.ta \w'\f3void \fPglRasterPos4i( 'u
GLint \fIy\fP,
GLint \fIz\fP,
GLint \fIw\fP )
.fi
void \f3glRasterPos4s\fP(
GLshort \fIx\fP,
.nf
.ta \w'\f3void \fPglRasterPos4s( 'u
GLshort \fIy\fP,
GLshort \fIz\fP,
GLshort \fIw\fP )
.fi
.EQ
delim $$
.EN
.SH PARAMETERS
.TP \w'\f2x\fP\ \f2y\fP\ \f2z\fP\ \f2w\fP\ \ 'u
\f2x\fP, \f2y\fP, \f2z\fP, \f2w\fP
Specify the $x$, $y$, $z$, and $w$ object coordinates
(if present)
for the raster position.
.SH C SPECIFICATION
void \f3glRasterPos2dv\fP(
const GLdouble \fI*v\fP )
.nf
.fi
void \f3glRasterPos2fv\fP(
const GLfloat \fI*v\fP )
.nf
.fi
void \f3glRasterPos2iv\fP(
const GLint \fI*v\fP )
.nf
.fi
void \f3glRasterPos2sv\fP(
const GLshort \fI*v\fP )
.nf
.fi
void \f3glRasterPos3dv\fP(
const GLdouble \fI*v\fP )
.nf
.fi
void \f3glRasterPos3fv\fP(
const GLfloat \fI*v\fP )
.nf
.fi
void \f3glRasterPos3iv\fP(
const GLint \fI*v\fP )
.nf
.fi
void \f3glRasterPos3sv\fP(
const GLshort \fI*v\fP )
.nf
.fi
void \f3glRasterPos4dv\fP(
const GLdouble \fI*v\fP )
.nf
.fi
void \f3glRasterPos4fv\fP(
const GLfloat \fI*v\fP )
.nf
.fi
void \f3glRasterPos4iv\fP(
const GLint \fI*v\fP )
.nf
.fi
void \f3glRasterPos4sv\fP(
const GLshort \fI*v\fP )
.nf
.fi
.SH PARAMETERS
.TP
\f2v\fP
Specifies a pointer to an array of two,
three,
or four elements,
specifying $x$, $y$, $z$, and $w$ coordinates, respectively.
.SH DESCRIPTION
The GL maintains a 3D position in window coordinates.
This position,
called the raster position,
is used to position pixel and bitmap write operations. It is
maintained with subpixel accuracy.
See \%\f3glBitmap\fP, \%\f3glDrawPixels\fP, and \%\f3glCopyPixels\fP.
.P
The current raster position consists of three window coordinates
($x$, $y$, $z$),
a clip coordinate value ($w$),
an eye coordinate distance,
a valid bit,
and associated color data and texture coordinates.
The $w$ coordinate is a clip coordinate,
because $w$ is not projected to window coordinates.
\%\f3glRasterPos4\fP specifies object coordinates $x$, $y$, $z$, and $w$
explicitly.
\%\f3glRasterPos3\fP specifies object coordinate $x$, $y$, and $z$ explicitly,
while $w$ is implicitly set to 1.
\%\f3glRasterPos2\fP uses the argument values for $x$ and $y$ while
implicitly setting $z$ and $w$ to 0 and 1.
.P
The object coordinates presented by \%\f3glRasterPos\fP are treated just like those
of a \%\f3glVertex\fP command:
They are transformed by the current modelview and projection matrices
and passed to the clipping stage.
If the vertex is not culled,
then it is projected and scaled to window coordinates,
which become the new current raster position,
and the \%\f3GL_CURRENT_RASTER_POSITION_VALID\fP flag is set.
If the vertex
.I is
culled,
then the valid bit is cleared and the current raster position
and associated color and texture coordinates are undefined.
.P
The current raster position also includes some associated color data
and texture coordinates.
If lighting is enabled,
then \%\f3GL_CURRENT_RASTER_COLOR\fP
(in RGBA mode)
or \%\f3GL_CURRENT_RASTER_INDEX\fP
(in color index mode)
is set to the color produced by the lighting calculation
(see \%\f3glLight\fP, \%\f3glLightModel\fP, and
.br
\%\f3glShadeModel\fP).
If lighting is disabled,
current color
(in RGBA mode, state variable \%\f3GL_CURRENT_COLOR\fP)
or color index
(in color index mode, state variable \%\f3GL_CURRENT_INDEX\fP)
is used to update the current raster color.
.P
Likewise,
\%\f3GL_CURRENT_RASTER_TEXTURE_COORDS\fP is updated as a function
of \%\f3GL_CURRENT_TEXTURE_COORDS\fP,
based on the texture matrix and the texture generation functions
(see \%\f3glTexGen\fP).
Finally,
the distance from the origin of the eye coordinate system to the
vertex as transformed by only the modelview matrix replaces
\%\f3GL_CURRENT_RASTER_DISTANCE\fP.
.P
Initially, the current raster position is (0, 0, 0, 1),
the current raster distance is 0,
the valid bit is set,
the associated RGBA color is (1, 1, 1, 1),
the associated color index is 1,
and the associated texture coordinates are (0, 0, 0, 1).
In RGBA mode,
\%\f3GL_CURRENT_RASTER_INDEX\fP is always 1;
in color index mode,
the current raster RGBA color always maintains its initial value.
.SH NOTES
The raster position is modified both by \%\f3glRasterPos\fP and by \%\f3glBitmap\fP.
.P
When the raster position coordinates are invalid,
drawing commands that are based on the raster position are
ignored (that is, they do not result in changes to GL state).
.P
Calling \%\f3glDrawElements\fP, or \%\f3glDrawRangeElements\fP may leave the
current color or index indeterminate.
If \%\f3glRasterPos\fP is executed while the current color or index is indeterminate, the
current raster color or current raster index remains indeterminate.
.P
To set a valid raster position outside the viewport, first set a valid
raster position, then call \%\f3glBitmap\fP with NULL as the \f2bitmap\fP
parameter.
.P
When the \%\f3GL_ARB_imaging\fP extension is supported, there are distinct
raster texture coordinates for each texture unit. Each texture unit's
current raster texture coordinates are updated by \%\f3glRasterPos\fP.
.SH ERRORS
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glRasterPos\fP
is executed between the execution of \%\f3glBegin\fP
and the corresponding execution of \%\f3glEnd\fP.
.SH ASSOCIATED GETS
\%\f3glGet\fP with argument \%\f3GL_CURRENT_RASTER_POSITION\fP
.br
\%\f3glGet\fP with argument \%\f3GL_CURRENT_RASTER_POSITION_VALID\fP
.br
\%\f3glGet\fP with argument \%\f3GL_CURRENT_RASTER_DISTANCE\fP
.br
\%\f3glGet\fP with argument \%\f3GL_CURRENT_RASTER_COLOR\fP
.br
\%\f3glGet\fP with argument \%\f3GL_CURRENT_RASTER_INDEX\fP
.br
\%\f3glGet\fP with argument \%\f3GL_CURRENT_RASTER_TEXTURE_COORDS\fP
.SH SEE ALSO
\%\f3glBitmap(3G)\fP,
\%\f3glCopyPixels(3G)\fP,
\%\f3glDrawArrays(3G)\fP,
\%\f3glDrawElements(3G)\fP,
\%\f3glDrawRangeElements(3G)\fP,
\%\f3glDrawPixels(3G)\fP,
\%\f3glTexCoord(3G)\fP,
\%\f3glTexGen(3G)\fP,
\%\f3glVertex(3G)\fP