[osg-users] update slave camera with frame scheme ON_DEMAND

Robert Osfield robert.osfield at gmail.com
Wed Aug 5 08:01:06 PDT 2015


Hi Gianni,

I'm looking at OSG-3.4 and the setting of the master Camera from the
CameraManipulator that happens after running the update traversals of the
scene and slave Camera's, so I presume you are looking at an older rev of
the OSG.

This doesn't change my suggestion though.

Robert.

On 5 August 2015 at 15:25, Gianni Ambrosio <g.ambrosio+osg at gmail.com> wrote:

> Thank you Robert for the explanation.
>
> Please don't blame me if I have a couple of questions.
>
> First of all, debugging the updateTraversal() implementation it seems the
> AxesCameraUpdateCallback is called twice: one in
>
> scene->updateSceneGraph(*_updateVisitor);
>
> and the second time in
>
> camera->accept(*_updateVisitor);
>
> I guess this is an expected behavior.
>
> Second, you say "The master Camera's value can depend upon values in the
> scene graph". But isn't the scene updated in updateSceneGraph call? While
> the slave cameras are updated in a couple of following for loops? I mean,
> couldn't the main camera view matrix be updated, I agree after the
> updateSceneGraph() call, but before the slave cameras? Or at least move the
> slave cameras with "_useMastersSceneData=false" after the main camera?
> Something like:
>
> Code:
>
>         if (view->getCameraManipulator())
>         {
>             view->setFusionDistance(
> view->getCameraManipulator()->getFusionDistanceMode(),
>
> view->getCameraManipulator()->getFusionDistanceValue() );
>
>             view->getCamera()->setViewMatrix(
> view->getCameraManipulator()->getInverseMatrix());
>         }
>
>          // Do UpdateTraversal for slaves with their own subgraph
>          for(unsigned int i=0; i<view->getNumSlaves(); ++i)
>          {
>                osg::View::Slave& slave = view->getSlave(i);
>                osg::Camera* camera = slave._camera.get();
>                if(camera && !slave._useMastersSceneData)
>                {
>                   camera->accept(*_updateVisitor);
>                }
>          }
>
>         view->updateSlaves();
>
>
>
>
> Regards,
> Gianni
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=64631#64631
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150805/f3f375a8/attachment-0003.htm>


More information about the osg-users mailing list