Angus Dorbie (dorbie++at++bitch.reading.sgi.com)
Thu, 19 Sep 1996 09:52:06 +0100
I bet you've changed the start position in the application or youre now
multiprocessing. Positional information set in the cull will be blown away
next frame by the information comming downstream from the application so
with your approach you have to set the position in the application every
now and and inflate the bound sphere.
It is OK to make the call (I've relied on this for post cull billboarding at
the DCS level) but remember that you still cull to the position set in the
application.
Rgds,
Angus.
On Sep 18, 4:24pm, Jeremy Friesner wrote:
> Subject: Is it okay to call pfDCS:setTrans() in post-cull node callback?
>
> Hi All,
>
> In order to save time in our Performer project (which contains lots of
> moving objects in the scene), I'd like to be able to only move the
> objects that are currently in the viewing frustum.
>
> It seems to do that, I would want to call pfDCS::setTrans() and
pfDCS::setRot()
> in the Post-node cull callback. This used to work--however, I can't get
> it to work anymore. :( What happens is after any call to setTrans() or
> setRot(), the object dissappears from the screen. It appears that the
> cull traversal is culling this function, because afterwards pfGetCullResult()
> returns 0 for that object.
>
> Any ideas as to what is going on here?
>
> Thanks,
> Jeremy
>
>
> ---- here's some relevant code ----
>
> ...
>
> // update scene graph only when node is visible!
> dcs->setTravFuncs(PFTRAV_CULL,
> PreNodeCullMoveCallback, PostNodeCullMoveCallback);
> ...
>
>
> extern int PreNodeCullMoveCallback(pfTraverser *, void *)
> {
> // do nothing for now
> return PFTRAV_CONT;
> }
>
>
> extern int PostNodeCullMoveCallback(pfTraverser* trav, void*)
> {
> pfDCS* dcs = (pfDCS*) trav->getNode();
> assert(dcs->pfIsOfType(pfDCS::getClassType()),
> "class type of node isn't pfDCS %s ", dcs->getTypeName());
>
> // turns out we get called for every node; let's see if we are visible
> // before we do motion calculations
> if (pfGetCullResult() == PFIS_FALSE) return PFTRAV_CONT;
>
> ObjectInfo * obinfo = (ObjectInfo*)dcs->getUserData();
> if (obinfo)
> {
> printf("obj moving to %f %f %f, %f %f %f\n",
> obinfo->loc.xyz[0], obinfo->loc.xyz[1], obinfo->loc.xyz[2],
> obinfo->loc.hpr[0], obinfo->loc.hpr[1], obinfo->loc.hpr[2]);
>
> dcs->setTrans(obinfo->loc.xyz[0], obinfo->loc.xyz[1],
obinfo->loc.xyz[2]);
> dcs->setRot(obinfo->loc.hpr[0], obinfo->loc.hpr[1],
obinfo->loc.hpr[2]);
> }
> return PFTRAV_CONT;
> }
>
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>-- End of excerpt from Jeremy Friesner
=======================================================================
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:53:34 PDT