Hi Robert,

> > Hi all, I have a scene graph containing a switch node
> (osg::Switch) having 4 children.
> >
> > What would be the best way to render this scene graph
> in 4 different views/viewports, with each child (attached
> under the osg::Switch) rendered in its own view? Thanks!
> 
> Is it just one subgraph within the whole subgraph that you
> want to
> appear differently on each viewport or do you have four
> entirely
> different subgraphs for each view?
> 
> If the former then the best way to handle this is to use a
> TraversalMask on the Camera matched to a NodeMask's in the
> scene
> graph, see osgstereoimage example, if the later use a
> osgViewer::CompositeViewer see osgcompositeviewer.
> 
> Robert.


Yes, I'd like to render one single scenegraph, however four times DIFFERENTLY 
(i.e. in four different views), and of course simultaneously.

Basically, my first idea was to have one "master" scenegraph, and then somehow 
replicate this master to four "slave" subgraphs on each frame. However this 
would quickly become cumbersome, so naturally I thought there should be a 
better way

I looked quickly into TraversalMask... Is my hunch correct when I say that:

- I make all four subgraphs (under Switch
) active 

- I set their masks to 1, 2, 4, and 8 respectively

- I take cameras of each of the four views in CompositeViewer, and set their 
masks to 1, 2, 4 and 8 respectively

- now the CULL traversals for all four views will cull respective subgraphs:

- CULL for view 1 culls subgraphs 2, 3, and 4
- CULL for view 2 culls subgraphs 1, 3, and 4
- CULL for view 3 culls subgraphs 1, 2, and 4
- CULL for view 4 culls subgraphs 1, 2, and 3


Am I on the right track? Thanks!
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to