Draw node callback

New Message Reply Date view Thread view Subject view Author view

Jean-Luc Dery (dery++at++cae.ca)
Fri, 31 May 1996 13:21:25 -0400


Hi Performers,

I have a question about draw node callbacks. In my application, a pre draw
callback function is set to some of the scene graph node that draws a box. The
callback function looks like this :

static int drawBoxCallback( pfTraverser *trav, void * )
{
...

      pts = colObj->colBox.getLocalVertices();

      cpack( 0xFF0000FF );

      for ( i = 0; i < VRCOL_BOX_MAXFACES; i++ ) {
        indices = colObj->colBox.getIndices( i );

        bgnclosedline();

        for ( j = 0; j < 4; j++ )
          v3f( pts[indices[j] );

        endclosedline();
      }
...
}

As is, everything works fine; the callback function is called once everytime
an object box node is entered and the box is drawn properly.

But earlier, I had made the mistake of using the box color defined as cpack(
0x000000FF ) which draws the boxes with transparency. With this color, some
of the boxes where drawn and others where not, and this changed according to
object position and orientation ... Ok, maybe because of transparent component.
 But what really suprised me is that for some given unique node, the draw
callback function was called more than once in the same frame; I don't
understand why !

Should'nt a node draw callback function be called once if this node only
appears once in the scene graph and has a unique parent, no matter what ?

Does anyone know, is there something I should know before using draw callback
functions ?

Thanks in advance for any hints,

-- 
____________________________________________________________________

Jean-Luc Dery CAE Electronics Ltd., 8585 Cote De Liesse System Engineer Saint-Laurent, Quebec, Canada, H4L-4X4 3-D Graphics Applications tel: +1 514 341 2000 extension 2275 dery++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


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:52:56 PDT

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