Randy Stiles (stiles++at++ict.atc.lmco.com)
Mon, 11 Oct 1999 15:18:46 -0700
I am drawing a live video texture background in the Performer draw
process using glRasterPos3f() followed by glDrawPixels(). If the raster
position is out of the Performer window screen boundaries, it does not
draw, and when I change the camera viewpoint, most often the raster
position is invalid.
So I wrote a routine to take the viewpoint matrix and transform the GL
raster position accordingly. This works fine for rotation, but does not
work correctly for translation, i.e. if I stay at the initial starting
camera point, and rotate, the raster positions I calcualte are correct.
But if I translate the camera position, they quickly become invalid.
Also, wherever I initialize the viewpoint at, my transform approach
works correctly for translation - its after that when I move the camera
that the video texture is not drawn.
1) What is the approach in Performer for the GL Raster position? I
noted that it is changed from regular OpenGL, with Y and Z rotated -90
(so that Y is the depth coordinate).
2) Does anyone know a fix for my glRasterPosition problem? I.e. what is
the correct way to transform the rasterposition when the camera
viewpoint is moving.
2) Is there a better (or faster) approach than glDrawPixels() for doing
a live video background (effectively a screen clear which paints a live
video texture)
I am using SGI Performer 2.2.6 on an SGI O2 running Irix 6.5.5. The
primary calls I make in the pfDraw process are below. I shut off depth
test during the video texture draw because I want all 3D objects
overlaid onto video.
GLint depthTest;
glGetIntegerv(GL_DEPTH_TEST, &depthTest);
glDisable(GL_DEPTH_TEST);
(... calculate raster position ...)
glRasterPos3f( vx, vy, vz );
glDrawPixels( gXsize*2, gYsize*2, GL_ABGR_EXT, GL_UNSIGNED_BYTE, image
);
(...)
glEnable(GL_DEPTH_TEST);
Thanks,
-Randy
-- // Randy Stiles mailto:stiles++at++ict.atc.lmco.com O/L922 B/153 // Lockheed Martin Advanced Technology Center 1111 Lockheed Way // office: 408.756.2848 fax: 408.756.2920 Sunnyvale, CA 94089 // http://vet.parl.com/~vet/
This archive was generated by hypermail 2.0b2 on Mon Oct 11 1999 - 15:32:10 PDT