Ok. I try the slave variant.

I have a additional question. When I use two different cameras and three 
viewports, how would you implement this. Two viewport have the first camera and 
the third viewport has the second camera.

My idea is something like this:

// Camera 1
osg::Camera* cam1 = new ...
slaveCam1->setViewport(...);

// Slave Camera 1
osg::Camera* slaveCam1 = new ...
slaveCam1->setViewport(...);

// Camera 2
osg::Camera* cam2 = new ...
cam2->setViewport(...);
cam2->addChild(scene);

// RootNode
// Camera two as a part of the scene graph. Is this clever?
osg::Group* root = new ...
root->addChild(scene);
root->addChild(cam2);

// Viewer
osg::Viewer* viewer = new ...
viewer->setSceneData(root);
viewer->setCamera(cam1);
viewer->addSlave(slaveCam1);


Is this the right way? And what is your commendation to use different camera 
manipulators. That means, what can I do when I want to use a manipulator for 
the second camera (the camera in the root node).

My idea is to write a GUIEventhandler. This should check the mouse position and 
give the viewport or the camera and then I calculate the new position like the 
trackball manipulator. That is the approximate idea.

Cheers

Martin


-------- Original-Nachricht --------
> Datum: Fri, 29 Oct 2010 09:21:29 +0100
> Von: Robert Osfield <[email protected]>
> An: OpenSceneGraph Users <[email protected]>
> Betreff: Re: [osg-users] Two Viewports with one Camera

> Hi Martin,
> 
> I'm a bit confused by the thread, but as a general note you shouldn't
> go attempting to use two separate Viewport per Camera.  The OSG fully
> supports slave Camera that can share scene graphs and share the same
> graphics context, so it's straight forward to implement and manage,
> the osgViewer design has been specifically designed to make this type
> of usage as simple as possible.
> 
> Robert.
> 
> 2010/10/29 "Martin Großer" <[email protected]>:
> > Hello all,
> >
> > I would like use two viewports in my application and one camera. Is this
> possible? I think, the normal way is to define the viewport for a camera
> like: camera->setViewport(...)
> >
> > Is the only way to define camera, copy the camera and set the viewports
> separatly for every camera? The main problem is when I change the camera
> settings, I have to copy the camera again.
> >
> > Cheers
> >
> > Martin
> > --
> > GMX DSL Doppel-Flat ab 19,99 &euro;/mtl.! Jetzt auch mit
> > gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
> > _______________________________________________
> > 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

-- 
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to