Hello, OK, for the completeness of my problem. I want to use two different viewer. An normal OSGViewer and a GTKViewer. The common denominator is the osg::Viewer class. I want to use one or more viewports and one or more cameras. And every camera can show different scenes. The cameras should have a manipulator like trackball manipulator. I guess the problem is not so trivial.
I try to do this: - First camera is the "master" camera (set camera and scene data in viewer) viewer->setCamera(cam_1); root->addChild(scene_1); viewer->setSceneData(root); - next camera set in the scene graph and the scene is a child of the camera cam_2->addChild(scene_2); root->addChild(cam_2); - and so on for more cameras with a scene - now I set the viewports cam_1->viewport(...); cam_2->viewport(...); - it works fine, but now I want to add a third viewport with the first camera, too cam_1->addChild(scene_1); root->addChild(cam_1); cam_1->setviewport(...); - it is unsurprising that doesn't work That is my actual state of affairs. Cheers Martin -------- Original-Nachricht -------- > Datum: Fri, 29 Oct 2010 11:14:56 +0200 > Von: "J.P. Delport" <[email protected]> > An: OpenSceneGraph Users <[email protected]> > Betreff: Re: [osg-users] Two Viewports with one Camera > Hi, > > On 29/10/10 11:02, "Martin Großer" wrote: > > Hello, > > > > the problem is that I want to use a embedded viewer (gtk), too. I > > guess it doesn't work with the composite viewer. Or is it possible? > > sorry, I'm not sure. > > jp > > > > > Cheers > > > > Martin > > > > > > -------- Original-Nachricht -------- > >> Datum: Fri, 29 Oct 2010 10:58:10 +0200 Von: "J.P. > >> Delport"<[email protected]> An: OpenSceneGraph > >> Users<[email protected]> Betreff: Re: [osg-users] > >> Two Viewports with one Camera > > > >> Hi, > >> > >> On 29/10/10 10:48, "Martin Großer" wrote: > >>> 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. > >> > >> Do you want something different from what happens if you run > >> "osgcompositeviewer cow.osg". There, each view can have its own > >> manipulator. > >> > >> jp > >> > >>> > >>> 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€/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 > >>> > >> > >> > >> > -- > >> This message is subject to the CSIR's copyright terms and > >> conditions, e-mail legal notice, and implemented Open Document > >> Format (ODF) standard. The full disclaimer details can be found at > >> http://www.csir.co.za/disclaimer.html. > >> > >> This message has been scanned for viruses and dangerous content by > >> MailScanner, and is believed to be clean. MailScanner thanks > >> Transtec Computers for their support. > >> > >> _______________________________________________ osg-users mailing > >> list [email protected] > >> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > > > -- > This message is subject to the CSIR's copyright terms and conditions, > e-mail legal notice, and implemented Open Document Format (ODF) standard. > The full disclaimer details can be found at > http://www.csir.co.za/disclaimer.html. > > This message has been scanned for viruses and dangerous content by > MailScanner, > and is believed to be clean. MailScanner thanks Transtec Computers for > their support. > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- GRATIS! Movie-FLAT mit über 300 Videos. Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

