glBitmap()

glBitmap() currently will move the raster position by an x and y value. This is not affected by any matrix transformations. How about a glRasterOffset() function that moves the raster position, applying the current matrix transformations to it? Or am I dumb, and there is already a way to do this I don’t know of?

Bitmaps are relative to the current raster position. And glRasterPos is affected by the modelview matrix (as well as glVertex is affected). So if you want to move your raster position you could use glTranslate before calling glRasterPos

Originally posted by vincoof:
Bitmaps are relative to the current raster position. And glRasterPos is affected by the modelview matrix (as well as glVertex is affected). So if you want to move your raster position you could use glTranslate before calling glRasterPos

Thank you very much, however, I already know this, and it’s not what I’m asking for. If you call RasterPos*() and the raster position would end up off-screen, then it is invalid. The only way to get an off-screen raster position is with glBitmap(). And glBitmap() doesn’t use the transformation matrices. I need to move the raster position, using the matrix transformations, and it needs to be able to be moved outside the viewport. Your solution doesn’t solve that, and as well as I can tell, nothing does, which is why I’m on this forum and not the help forum.

Keith

[This message has been edited by kjackson (edited 12-09-2002).]

You can use glWindowPos to set a valid off screen raster position. It also bypasses all transformations, so no need to setup proper modelview and projection matrix. If you want to use a point in 3D space as raster position, project the point to screen coordinates and use glWindowPos.

glWindowPos? Don’t think there’s such a function. You mean glRasterPos? glRasterPos does go through the matrix transformations, and moreso, if the point would be culled, the raster position becomes invalid.

Keith

I remember there’s a trick to force an invalid position to be valid. I don’t remember it though, but I’m sure I’ve read it somewhere, probably in OpenGL FAQs.

edit: ok I’ve found it again here : http://www.opengl.org/developers/faqs/technical/clipping.htm#0070 and I guess that was the trick you were talking about.

btw, glWindowPos is available since OpenGL1.4, and was promoted from the ARB_window_pos extension.

[This message has been edited by vincoof (edited 12-10-2002).]

No, I’m talking about glWindowPos. As vincoof said, it’s a part of OpenGL 1.4, or as an extension to earlier versions. Very convenient function if you want to draw pictures with glBitmap or glDrawPixels. No messing with matrices needed.

And GL_ARB_window_pos was promoted from GL_MESA_window_pos, right?

Yes, but with some minor modifications.