From: Don Burns (don_burns++at++peru.engr.sgi.com)
Date: 02/14/2000 08:19:46
On Feb 13, 8:25pm, Satheesh Ganapathi Subramanian wrote:
> Subject: Model and View matrices
> Hi Performers,
>
> Is there a way I can obtain the current Modeling and Viewing matrices
> separately using Performer?
>
> Thanks,
> Satheesh
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>-- End of excerpt from Satheesh Ganapathi Subramanian
I'll assume you typoed and meant Projection matrix and Modelview matrix. If in
a callback in which a pfTraverser is given:
pfChannel *chan = trav->getChan();
pfFrustum frust;
chan->getBaseFrust( &frust );
pfMatrix projMat;
frust.getGLProjMat( projMat );
//projMat is your projection matrix.
pfMatrix viewMat;
chan->getViewMat( viewMat );
viewMat.invertAff( viewMat );
pfMatrix modelMat;
modelMat.makeRot( -90, 1, 0, 0 );
modelMat.preMult( viewMat );
// You now have the "bare" model view matrix in modelMat.
// Premultiply the accumulated transforms up to this point
// in the scene graph traversal (stored in trav)
pfMatrix accumulated_tx;
trav->getMat( accumulated_tx );
modelMat.preMult( accumulated_tx );
// voila'
-don
This archive was generated by hypermail 2b29 : Mon Feb 14 2000 - 08:20:11 PST