Gettting the modelview matrix from precull callback

New Message Reply Date view Thread view Subject view Author view

Shankar Swamy (shankar++at++redwood.rt.cs.boeing.com)
Thu, 4 Sep 1997 21:48:58 -0700


I need to compute the modelview matrix that performer loads for
rendering a given geode. Here is what I am trying (and failing to
get the right matrix):

Inside the precull-callback:

1. Get the view matrix for the channel: pfChannel::getViewMat(myPfVMat);

2. Collect the transformations from DCS's/SCS's along the path to the
   geode: pfTraverser::getMat(myCMat);
3. myPfVMat->preMult(myCMat);
4. Transform to OpenGL system by a 90-degree rotation about x-axis and
   then a transpose:
   myTmpMat.preRot(90, 1,0,0, myPfVMat) ;
   myOglMat.transpose(myTmpMat) ;

Now, I compare this with the OpenGL modelview matrix that I get by doing
glGetFloatv(GL_MODELVIEW_MATRIX, ...) in the post/pre-draw callbacks for
the same node, I get a different matrix!!

Does someone see what's going wrong here?

Some additional info that might be relevant:

1. I have tried minor variations of the above such as postRot(..) in place of
    preRot(...) etc. :-)

2. I need to get this in the precull-callback because for my application,
    based on the nature of the modelview matrix, at times I cull the geode.
    So obtaining the MODELVIEW matrix from the draw callbacks is not an
    option.

Thanks,

- shankar swamy
----------------------------------------------------------------------------
shankar++at++boeing.com
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:53 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.