glRasterPos2x in Inventor

glRasterPos2x in Inventor

Post by Han-Wei Sh » Thu, 07 Sep 1995 04:00:00



Hi,

I am trying to use Open GL glRasterPos2x() and glDrawPixels()
function calls in my Open Inventor application. What I did is to
attach a SoCallback node into my scene node. However, I found that
the pixel positions specified by glRasterPos2i() are affected somehow
by OpenInventor's transformation. Is there anyway that I can avoid that
so the pixel positions specified by glRasterPos2i can appear exactly
on the drawing window??

Any help will be appreciated,

Han-Wei Shen
Dept. of Computer Science
University of Utah

 
 
 

glRasterPos2x in Inventor

Post by Dirk VanGeld » Fri, 08 Sep 1995 04:00:00


Quote:> I am trying to use Open GL glRasterPos2x() and glDrawPixels()
> function calls in my Open Inventor application.

Raster position in OpenGL is modified by the modelview, projection,
and viewport transforms. If you want to specify x,y coordinates for
the bottom left of the image in normalized coordinates (range=0 to 1
for x and y) try setting up a camera like:

SoOrthographicCamera *camera = new SoOrthographicCamera;
camera->viewportMapping = SoCamera::LEAVE_ALONE;
camera->height = 1;
camera->position.setValue(0.5, 0.5, 1);

Also, remember to disable things like blending and zbuffering
before the glDrawPixels call to increase speed.

-Dirk Van Gelder

 Engineering Animation, Inc.