pfPushMatrix/pfPopMatrix in Traveral CB?

New Message Reply Date view Thread view Subject view Author view

Elke Hendon (elke++at++tyrann.atlas.de)
Mon, 12 Sep 1994 11:53:30 +0000 (GMT-1:00)


Dear Performer,

I wish to change the viewing matrix for a particular node so that the
object remains "apparently" always in front of my viewpoint. Of course
one could solve this by making this object a DCS. However, I wanted to
try pfPushIdentMatrix in a Traversal callback (is this ok?). I does not
seem to work, for the ovject is transformed as normal according to the
view matrix for the channel (pfChanView). Here is sample code. Where
have I gone wrong?

//During APP, before simloop:
setup()
{
  pfNodeTravMask(node, PFTRAV_CULL,0L,PFTRAV_SELF|PFTRAV_DESCEND,PF_SET);
  pfNodeTravMask(node,PFTRAV_DRAW,0xffffffff,PFTRAV_SELF|PFTRAV_DESCEND,PF_SET);
  pfNodeTravFuncs(node,PFTRAV_CULL,x_precull,x_postcull);
  pfNodeTravFuncs(node, PFTRAV_DRAW, x_predraw, x_postdraw);

}

static long x_precull(pfTraverser *trav, void *data)
{
        return(PFTRAV_CONT);
}

static long x_postcull(pfTraverser *trav, void *data)
{
        return(0);
}

static long x_predraw(pfTraverser *trav, void *data)
{
        pfPushIdentMatrix();
        return(PFTRAV_CONT);
}
static long x_postdraw(pfTraverser *trav, void *data)
{
        pfPopMatrix();
        return(PFTRAV_CONT);
}

will subordinate nodes of "node" likewise obey this traversal rule?

Thanks for hints and help!!
  
---------------------------------------------------------------------------
K.Stuehrmann Atlas Elektronik GmbH, D-28305 Bremen,
                 Sebaldsbruecker Heerstr. 235,
                 Simulation Division
                 elke++at++tyrann.atlas.de
---------------------------------------------------------------------------


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:50:32 PDT

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