Amaury Aubel (aubel++at++lig.di.epfl.ch)
Thu, 4 Sep 1997 09:45:21 -0600
Yes it is, by setting an appropriate callback function.
As the LOD passage occurs first in the CULL process, you set a pre-cull
drawback function on the pfLOD itself.
It might look like:
LOD_callback(pfTraverser *trav, void *userData)
{
...
pfLOD *lod = (pfLOD*) pfGetTravNode(trav);
pfMatrix mat;
int child;
...
pfGetTravMat(trav, mat);
/* get LOD's active child */
child = (int) pfEvaluateLOD(lod, pfGetTravChan(trav), &mat);
/* Has a switch occured? */
if ( child!=*index )
{
printf("switch LOD: child %d index %d\n",child,index);
/* do what you have to here
probably something like
switch (child) {
case 1: prindData1() etc. */
*index = child;
}
return PFTRAV_CONT;
}
index is a shared memory variable where the current LOD is stored. So upon
initialization it must be assigned the right value.
Hope this helps,
Amaury.
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:52 PDT