Hi Michel, I post the same question a few weeks ago. The solution is setting the camera NodeMask to 0x0 to disable it and 0xffffffff again to enable it.
hope this helps. Michel van Elk escribió:
Hi, Depending on a user-controlled layout I'd like to enable/disable certain views in a compositeviewer. That way I can switch between a single view, 2x2 views etc. I can disable views by setting their viewport to (0,0,0,0) but I assume this will make them render anyway, loosing performance to useless tasks. So I've tried to dynamically add/remove the views from/to the compositeviewer, depending on which layout the user chooses. Now here some problems occur. When I remove a view from the compositeviewer its camera is somehow destroyed or corrupted. My code is like this: //first initialize the compositeviewer with some views, this works OK //get the camerapointer from fist view, works OK! osg::Camera *cam1=m_pView[0]->getCamera(); //now remove the view from the compositeviewer m_pCompositeViewer->removeView(m_pView[0]); //ask for the camerapointer again, now I get an invalid pointer! osg::Camera *cam2=m_pView[0]->getCamera(); Can anyone explain this behaviour? Is it logical that camera's are thrown away if views are not used anymore by a viewer? Is there another way to temporarily disable views? Thanks for any help! Michel _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
_______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/