Jean-Sébastien Guay wrote:
> From scratch, I couldn't find another cull callback that did things
> before and after the traverse() in the examples... Any suggestions?

  I dug back into my e-mail archives and found a message from Robert on 
10/7/2003 that I
used as my inspiration:


There isn't at present a away to disable the computation of the near far for a
subgraph via settings on Node's.  However, what you might be able to try
would be to disable the near far computation via a NodeCallback attached to
the skydome subgraph.  Something like

struct MyCullCallback : public osg::NodeCallback
{
         virtual void operator()(Node* node, NodeVisitor* nv)
        {
                osgUtil::CullVisitor* cv = 
dynamic_cast<osgUtil::CullVisitor*>(nv);
                osgUtil::CullVisitor::ComputeNearFarMode saveComputeNearFar;
                if (cv)
                {
                        saveComputeNearFar = cv->getComputeNearFarMode()
                        cv->setComputeNearFarMode(
osgUtil::CullVisitor::COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES);
                }

                traverse(node,nv);

                if (cv)
                {
                        saveComputeNearFar = cv->getComputeNearFarMode()
                        cv->setComputeNearFarMode(saveComputeNearFar);
                }
        }
}



  Now, there's some missing semicolons there, but those are easy to fix. Oddly 
though, it
looks like he's recommending switching to 
COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES and I
think it should be DO_NOT_COMPUTE_NEAR_FAR. Also, the lower saveComputeNearFar =
cv->getComputeNearFarMode() should not be there. But, I think this demonstrates 
you're on
the right track, and maybe just need to debug what's really happening at 
runtime.

> J-S


-- 
Chris 'Xenon' Hanson, omo sanza lettere                  Xenon AlphaPixel.com
PixelSense Landsat processing now available! http://www.alphapixel.com/demos/
"There is no Truth. There is only Perception. To Perceive is to Exist." - Xen
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to