Hi Lars,

On Mon, Sep 26, 2011 at 11:58 AM, Lars Karlsson <[email protected]> wrote:
>
> Any ideas or pointers as of how to architect this in OSG? Thank you.
>

I've accomplished the same thing you are trying to do by using cull
callbacks on each node. It gives you much more flexibility than node masks.

There are many ways to go about this. I created a custom data structure that
stores a unique identifier for each view, and saved this data structure in
the user data field of the cull visitor of the view. My cull callback then
retrieves this identifier from the cull visitor and determines whether or
not to render to the view.

My cull callback maintains a list of all the view identifiers it is either
allowed or not allowed to render to. This way you are not limited to 32 bit
node masks to control the rendering of nodes.

Hope this information was helpful and let me know if you would like more
details.

Cheers,
Farshid


>
>
> --- On Mon, 9/26/11, Ulrich Hertlein <[email protected]> wrote:
>
> > From: Ulrich Hertlein <[email protected]>
> > Subject: Re: [osg-users] Switch node, and multiple views
> > To: "OpenSceneGraph Users" <[email protected]>
> > Date: Monday, September 26, 2011, 10:56 AM
> > Hi Lars,
> >
> > On 26/09/11 11:30 , Lars Karlsson wrote:
> > > Yes, I'd like to render one single scenegraph, however
> > four times DIFFERENTLY (i.e. in
> > > four different views), and of course simultaneously.
> > > ...
> > > 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!
> >
> > Yes, except instead of a Switch you would probably just use
> > a Group for this, unless you
> > want to disable/switch the subgraphs as well.
> >
> > Cheers,
> > /ulrich
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to