- specify the raster position for pixel operations
C SPECIFICATION
PARAMETERS
_param1, _param2, _param3, _param4
Specify the x, y, z, and
w object coordinates (if
present) for the raster
position.
C SPECIFICATION
PARAMETERS
_param1
Specifies a pointer to an array of two, three, or
four elements, specifying x, y, z, and w coordi-
nates, respectively.
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 main-
tained with subpixel accuracy. See glBitmap,
glDrawPixels, and glCopyPixels.
The current raster position consists of three window coor-
dinates (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 coordi-
nates. glRasterPos4 specifies object coordinates x, y, z,
and w explicitly. glRasterPos3 specifies object coordi-
nate x, y, and z explicitly, while w is implicitly set to
1. glRasterPos2 uses the argument values for x and y
while implicitly setting z and w to 0 and 1.
The object coordinates presented by glRasterPos are
treated just like those of a glVertex command: They are
transformed by the current modelview and projection matri-
ces 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 GL_CURRENT_RASTER_POSITION_VALID flag is set. If
the vertex is culled, then the valid bit is cleared and
the current raster position and associated color and tex-
ture coordinates are undefined.
The current raster position also includes some associated
color data and texture coordinates. If lighting is
enabled, then GL_CURRENT_RASTER_COLOR (in RGBA mode) or
GL_CURRENT_RASTER_INDEX (in color index mode) is set to
the color produced by the lighting calculation (see
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, GL_CURRENT_RASTER_INDEX
is always 1; in color index mode, the current raster RGBA
color always maintains its initial value.
NOTES
The raster position is modified both by glRasterPos and by
glBitmap.
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).
Calling glDrawElements, or glDrawRangeElements may leave
the current color or index indeterminate. If glRasterPos
is executed while the current color or index is indetermi-
nate, the current raster color or current raster index
remains indeterminate.
To set a valid raster position outside the viewport, first
set a valid raster position, then call glBitmap with NULL
as the bitmap parameter.
When the GL_ARB_imaging extension is supported, there are
distinct raster texture coordinates for each texture unit.
Each texture unit's current ratster texture coordinates
are updated by glRasterPos.
ERRORS
GL_INVALID_OPERATION is generated if glRasterPos is exe-
cuted between the execution of glBegin and the correspond-
ing execution of glEnd.
ASSOCIATED GETS
glGet with argument GL_CURRENT_RASTER_POSITION
glGet with argument GL_CURRENT_RASTER_POSITION_VALID
glGet with argument GL_CURRENT_RASTER_DISTANCE
glGet with argument GL_CURRENT_RASTER_COLOR
glGet with argument GL_CURRENT_RASTER_INDEX
glGet with argument GL_CURRENT_RASTER_TEXTURE_COORDS
SEE ALSO
glBitmap, glCopyPixels, glDrawArrays, glDrawElements,
glDrawRangeElements, glDrawPixels, glTexCoord, glTexGen,
glVertex
1