Guillermo E. Gutierrez (ggutierr++at++harris.com)
Tue, 12 Oct 1999 10:01:58 -0400
Lately I've been working mostly on Java3d rather than Performer but the way
to do this should pretty much be the same (I would think). What you have
to do is to translate the camera back to the origin every time, apply your
rotation, and translate back. In Java3d it's pretty easy to extract the
translation component out of a TransformGroup's transform. I imagine the
same is true for Performer.
Just my $0.02.
-guillermo
ggutierr++at++harris.com
Randy Stiles wrote:
> Hi,
>
> 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/
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
begin:vcard
n:Gutierrez;Guillermo
tel;fax:407-984-6323
tel;work:407-984-6543
x-mozilla-html:TRUE
org:Harris Corporation;GCSD
adr:;;;;;;
version:2.1
email;internet:ggutierr++at++harris.com
title:Software Engineer
x-mozilla-cpt:;-19648
fn:Guillermo Gutierrez
end:vcard
This archive was generated by hypermail 2.0b2 on Tue Oct 12 1999 - 07:02:42 PDT