<div dir="ltr"><div><div><div>Hi Jannik,<br><br></div>Just catching up with this thread, but am afraid my brain isn't yet clear enough this Monday morning to be able spot anything.  I'm afraid I'm still a bit foggy brained, did a 38 mile, hilly and muddy ultramarathon at the weekend :-)<br><br></div>For now I don't have anything else to add to your experiments.  If you are still struggling after your latest experiments I'll just to my head around the issue later.<br><br></div>Robert.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 24 October 2015 at 22:50, Jannik Heller <span dir="ltr"><<a href="mailto:scrawl@baseoftrash.de" target="_blank">scrawl@baseoftrash.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok, setting on projectionCullingStack works fine for the whole subgraph, you just have to transform the plane to view space first:<br>
<br>
<br>
Code:<br>
<br>
    virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)<br>
    {<br>
        osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(nv);<br>
        if (cv)<br>
        {<br>
            osg::CullingSet& cullingStack = cv->getProjectionCullingStack().back();<br>
<br>
            osg::Polytope::PlaneList origPlaneList = cullingStack.getFrustum().getPlaneList();<br>
<br>
            osg::Plane transformed = mCullPlane;<br>
            transformed.transform(cv->getCurrentCamera()->getViewMatrix());<br>
<br>
            cullingStack.getFrustum().add(transformed);<br>
<br>
            traverse(node, nv);<br>
<br>
            // undo<br>
            cullingStack.getFrustum().set(origPlaneList);<br>
        }<br>
        else<br>
            traverse(node, nv);<br>
    }<br>
<br>
<br>
<br>
It's a bit ugly, but good enough for me. Unless Robert has a better idea, I'll stick with this approach!<br>
<br>
Cheers,<br>
Jannik[/code]<br>
<span class=""><br>
------------------<br>
Read this topic online here:<br>
</span><a href="http://forum.openscenegraph.org/viewtopic.php?p=65434#65434" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=65434#65434</a><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</div></div></blockquote></div><br></div>