Hi Robert, Both my master and slave cameras have matching cull settings, set to COMPUTE_NEAR_FAR_USING_BOUNDING_VOLUMES. Somehow though, this doesn't work when my scene is under the slave camera. My bounding box is defined as a callback on the unique leaf drawable node I have in my graph. Z near/far calculations work fine when used with the master camera. I can't understand why I cannot retrieve a correct frustrum. Is there anything else I need to do?
Cheers, Fred robertosfield wrote: > Hi Fred, > > The OSG by default automatically computes the near/far values during > the cull traversal so you don't normally need to worry about the > specific settings of near/far. The 1.0 and 10000.0 are simply default > values and are of no particular note. The osg::Camera inherits from > osg::CullSettings so have a look at CullSettings if you want to look > at the various settings that you can control, in particular the > near/far computation. > > Robert. > > On 31 May 2013 21:54, Fred Smith <> wrote: > > > Hi, > > > > I can render my scene graph fine when declared under the master camera in > > my viewer. > > What I am focused on is the Z far and near values, I must ensure they're > > good - I can inspect the view and projection matrix, render the viewing > > frustrum (as lines for instance), and observe that the Z far and near > > values are correctly set to enclose all objects in my scene. All good. > > > > I then create a PRE_RENDER, RELATIVE_RF, FBO-bound slave camera, and move > > over my whole scene graph to a child of this slave camera. The master > > camera just has the slave camera as a child now, which itself references my > > original scene graph. > > > > Finally I render the whole scene (viewer->frame()) and capture the contents > > of my framebuffer to an image file (using shaders) : it works fine. > > However, I can't get to display the viewing frustrum as I did before. The > > slave's camera view/proj matrices have been set to identity in my setup, so > > my expectation is that the slave camera retains the same view and > > projection as the master camera, right? > > > > Here, the projection part is okay, but not the depth range. The Z far and > > near values are way outplaced, very far away from the viewpoint (crazy > > values like 1.0 to 10000.0 in my situation). > > How can I get the frustrum's properties correctly? > > > > Thank you! > > > > Cheers, > > Fred > > > > ------------------ > > Read this topic online here: > > http://forum.openscenegraph.org/viewtopic.php?p=54358#54358 > > > > > > > > > > > > _______________________________________________ > > osg-users mailing list > > > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > _______________________________________________ > osg-users mailing list > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > ------------------ > Post generated by Mail2Forum ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=54360#54360 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

