Re: preIsectFunc bad trav matrix

New Message Reply Date view Thread view Subject view Author view

Swaminathan N. (swami++at++evl.uic.edu)
Wed, 16 Apr 1997 18:09:11 -0500 (CDT)


On Wed, 16 Apr 1997, Steve Baker wrote:

> Chehayeb, Nassouh <nchehayeb++at++ceit.es> asked:
>
> > this is an example code tha I use to get the node isect matrix In
> > the ISECT process.
> >
> > int vrPoolIsect::preIsectFunc(pfTraverser *trav, void *data)
> > {
> > pfMatrix mat;
> > ...
> > trav->getMat(mat);
> > ...
> > }
> >
> > The node used to set the traverser CB is a pfDCS with a changing matrix,
> > The result of printing is an Ident matrix instead of the dcs matrix at
> > ISECT time.
> >
> > Am I making a mistake or its a Performer bug?
>
> Bernard Leclerc <bleclerc++at++cae.ca> replied:
>
> > If you're using a pre-Isect callback, the DCS matrix is not yet applied.
> > You can change to a post-Isect callback if you're interested in the
> > current transformation matrix after the DCS matrix is applied.
> >
> > However if you're interested in the current value of the DCS matrix, you
> > should do this
> >
> > pfDCS* dcs = (pfDCS*) trav->getNode();
> > dcs->getMat(mat);
>
> ..but that only works for DCS's - what about other kinds of nodes?
>

I guess maybe you are confusing the traversal matrix and the pfDCS matrix. The
DCS matrix is not applied to the traversal matrix while in pre-callback mode,
as Mr Leclerc pointed out. Thus your DCS matrix could be changing, but the
pre-traversal matrix remains identity. I've used trav->getMat(mat) quite
successfully (meaning, it did what I thought and wanted it do). In fact a code
stub in preCB_DCS looks like

  pfMatrix traversal
  trav->getMat(traversal);
  pfMatrix m;
  pfdcs->getMat(m);
  traversal.preMult(m);

bye
Swami

 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
v Swaminathan Narayanan ^
v swami++at++evl.uic.edu ^
v Office: 996-3002 ^
v Home: 850-2726 ^
v http://www.evl.uic.edu/swami ^
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

=======================================================================
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:05 PDT

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