Hi Sebastien, The Camera::setRenderOrder(RenderOrder,int) method controls the rendering order that cameras are rendering in. If you have just one camera active per view then you'd use something like:
v1->getCamera()->setRenderOrder(osg::Camera::PRE_RENDER); v2->getCamera()->setRenderOrder(osg::Camera::POST_RENDER); // or... v1->getCamera()->setRenderOrder(osg::Camera::NESTED_RENDER,0); v2->getCamera()->setRenderOrder(osg::Camera::NEDTED_RENDER,1); The rendering ordered PRE_RENDER negative to positive, NESTED_RENDER negative to positive, POST_RENDER negative to positive. Robert. On Wed, Dec 3, 2008 at 2:45 PM, Sebastien Roy <[EMAIL PROTECTED]> wrote: > Hi everyone, > > Does anyone know what exactly determines the rendering order of the > views in a CompositeViewer? This is important in my case because I > intend to have the various viewports overlap. > > Clearly, the original rendering order follows the order of the > addView(). But if you later change the list order, say by using > removeView() and then addView() again, the order is changed in the list > of views but not in the rendering order. This is unexpected. > > Then, how can I dynamically change the rendering order of the views? > > This might relate to the following observation: > Say I have two views v1,v2 added to a Compositeviewer cv: > > osg::ref_ptr<osgViewer::View> v1 = new osgViewer::View; > osg::ref_ptr<osgViewer::View> v2 = new osgViewer::View; > ... > cv->addView(v1.get()); > cv->addView(v2.get()); > ... > When I remove a view later, say cv->removeView(v1.get()), any ongoing > animation freezes in place but the view still gets rendered, until I > explicitely destroy it (v1=NULL), or until there is any input event in > the CompositeViewer window (immediately crashing osg). > > Thank in advance for comments or suggestions, > Regards, > > Sébastien > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org