I'm currently using the viewer.getCamera()->setUpdateCallback() to assigna custom callback that does stuff on a per-frame basis.  Is it safe to retrieve the camera->getRenderer()->getSceneView(0)->getCullVisitor()->getCalculatedNear/FarPlane() ?  are those values valid and available at that point?



March 29, 2013 9:35 AM
Hi Randall,


The CullVisitor computes and maintains the near/far values when these need computing.  Have a look at osgUtil::CullVisitor.

Robert.
March 29, 2013 9:18 AM
Well, I want to do it "in" the frame.. Basically, I'm hoping to get OSG to do the scene traversal for culling, etc, then read the znear/zfar values to be sent elsewhere while the geometry is pushed down the pipe.  I don't need perfectly accurate znear/far, just the bounding box estimates.






March 24, 2013 4:05 PM
Hi Randal,

it is easy ..... somewhere in the loop, probably after the frame all you have to do is to get the projection matrix like

while (!viewer.done())
{
viewer.frame();
viewer.getCamera()->getProjectionMatrixAsFrustum(arguments .... )




--
trajce nikolov nick
March 23, 2013 10:41 PM
Is there (I'm sure there is) a way to retrieve the autocalculated ZNear & ZFar from the scene graph on a per-frame basis? I figure it's somewhere in a traversal structure, but I'm not exactly sure where or how to get to it.

Can someone enlighten me?

--
Randall Hand
www.yeraze.com
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to