Nicolas Gauvin (nicolas++at++cae.ca)
Thu, 6 Jun 1996 14:45:49 -0400
Basically you want to get the same transformation matrices that Performer
sends to GL.
Here are two suggestions for doing this:
1) Using Performer only:
// get the viewing matrix from your channel
chan->getViewMat( viewMat );
// get the channel frustum
chan->getBaseFrust( frust );
// get the projected GL matrix from this frustum
frust->getGLProjMat( projMat );
// the final transformation matrix is the product of both
mat = viewMatrix * projMatrix;
you can now apply this matrix to your 3D vertices and get their 2D screen coords
Unless I'm wrong this should give you the same result as Performer.
2) Using GL directly:
In the DRAW process you can get those two matrices from IRISGL:
mmode( MPROJECTION )
getmatrix( projMat );
mmode( MVIEWING )
getmatrix( viewMat );
With OpenGL you should use:
glGetFloatv( GL_PROJECTION_MATRIX, ...
and
glGetFloatv( GL_MODELVIEW_MATRIX, ...
but you need to be carefull here since OpenGL has different axis orientations
then IrisGL.
Nicolas Gauvin CAE Electronics Ltd., 8585 Cote De Liesse
Software Developer Saint-Laurent, Quebec, Canada, H4L-4X4
3-D Graphics Applications tel: +1 514 341 2000 extension 2275
nicolas++at++cae.ca fax: +1 514 340 5496
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer.html
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:59 PDT