glRasterPos question

Member
Posts: 321
Joined: 2004.10
Post: #1
are glRasterPosi() functions meant for glOrtho() viewing volumes
and glRasterPosf() functions meant for gluPerspective viewing volumes?

I got a program using glReadPixels(), glCopyPixels(), and glDrawPixels()
and glOrtho working fine. Then I copied the program and tried to
rework it using gluPerspective() and glRasterPosf(). I keep getting
a blank screen. I tried using the the query commands to get more
information. But the code snippet below doesn't even seem to work.

GLboolean validRastersFloatBool[] = {GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE};
float rastersFloat[] = {0.0, 0.0, 0.0, 0.0};

glRasterPos3f( 2.3, 1.4, 1.3); // raster position inside viewing area.
glGetFloatv( GL_CURRENT_RASTER_POSITION, rastersFloat);
glGetBooleanv( GL_CURRENT_RASTER_POSITION_VALID, validRastersFloatBool );

The debugger is showing values of 0.0, 0.0, 0.0, 1.0 for the Raster vector.
The boolean valid raster vector is showing 0 0 0 0, which is saying that all are
invalid, right?

Can anybody shed light on this. Many thanks in advance.
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #2
glRasterPosi takes integer values (hence the i part)
glRasterPosf takes floating point values (hence the f part)

Nearly all OpenGL functions use this coding convention.
Quote this message in a reply
Member
Posts: 321
Joined: 2004.10
Post: #3
Got glRasterPos3f() working when I changed the z raster position. I think there
is something with the Near and Far parameters with gluPerspective(), that I
haven't fully investigated.

So glRasterPos3i() and glRasterPos3f() are pretty much replaceable for
each other; although I could see how the Pos3f() would lend itself to
gluPerspective and Pos3i() to glOrtho viewing volumes.

Did notice this to which the Red Book doesn't seem to explicitly comment:
Any thing less than 0, 0 in the Pos3if() functions (at least in the x and y dims)
is invalid and will display a blank screen. So the clipping of the Pixel Maps
outside of the viewing area is only done for x and y > zero. x and y < zero
is considered invalid.
Quote this message in a reply
Post Reply