Re: [osg-users] Recommended way to render a scene from multiple independent viewpoints

2017-04-11 Thread Hannes Naude
Robert Thanks so much for your help. That makes a lot of sense. I'll go implement the approach where the traversal is stopped at the shared subgraph root. Regards Hannes On Tue, Apr 11, 2017 at 8:08 PM, Robert Osfield wrote: > HI Hannes, > > The osgViewer has a

Re: [osg-users] Recommended way to render a scene from multiple independent viewpoints

2017-04-11 Thread Robert Osfield
HI Hannes, The osgViewer has a mechanism for avoid multiple traversals of shared scene graphs if mutlple View's share the same root node of the scene graph. If shared component isn't the topmost node then the OSG has no straight forward way to know whether a subgraph has been traversed or not

Re: [osg-users] Recommended way to render a scene from multiple independent viewpoints

2017-04-11 Thread Hannes Naude
Thanks Riccardo and Robert for your inputs. Robert, yes you are correct that the only issue I had with the CompositeViewer was that the same Node's callback would get called as many times as views that it appeared in. This means that for example if I have a simple update that would translate a

Re: [osg-users] Recommended way to render a scene from multiple independent viewpoints

2017-04-11 Thread Robert Osfield
HI Hannes, The CompositeViewer was written specifically for your usage case - i.e. multiple Views. I wouldn't recommend using slave Camera's for doing multiple views, while possible it's just a mess in terms of management. slave Camera's are tools for helping rendering a single view, but with a

Re: [osg-users] Recommended way to render a scene from multiple independent viewpoints

2017-04-11 Thread Riccardo Corsi
Hi Hannes, for the camera setup you're after I recommend using a SlaveUpdateCallback, which will be called once per frame for each slave camera, allowing you to manipulate the camera position/orientation at will. Here's a code snippet: // implement a slave callback to place the camera as you

Re: [osg-users] Recommended way to render a scene from multiple independent viewpoints

2017-04-11 Thread Hannes Naude
I think I solved my own problem. I was planning to use viewer.addSlave(cam,...) and then use cam->setReferenceFrame(osg::Transform::ABSOLUTE_RF) to decouple the slave camera from the master. (If this is not the best approach, I would still like to hear, but it seems pretty clean) It turned

[osg-users] Recommended way to render a scene from multiple independent viewpoints

2017-04-11 Thread Hannes Naude
Hi all I am trying to render a single scene from multiple viewpoints. I initially implemented this with a compositeviewer as per the osgthirdpersonview example. This worked fine except that my update callbacks appeared to be getting called more than once per render cycle. I assumed that the