Hi Mukend, You won't need to use a side by side viewport when you are using quad buffer stereo, instead just use a viewport that covers the whole window.
Robert. On Mon, Mar 28, 2011 at 7:13 PM, Mukund Keshav <osgfo...@tevs.eu> wrote: > Hi Everyone, > > This is a continuation from my old thread on Stereoscopy. The thread had > become a little huge, so i created a new thread. > > Well, as per the valuable suggestions from Robert and other members from the > forum, i wrote the following code. > > Code: > > // ========================= Left eye > ==================================================== > osg::ref_ptr<osg::Camera> camera = new osg::Camera; > camera->setGraphicsContext(gc.get()); > camera->setViewport(new osg::Viewport(0,0, traits->width / 2, > traits->height)); > GLenum buffer = GL_BACK_LEFT; > camera->setDrawBuffer(buffer); > > // add this slave camera to the viewer, with a shift left of the > projection matrix > viewer.addSlave(camera.get(), osg::Matrixd::translate(params), > osg::Matrixd()); > > > // ========================= Right eye > ==================================================== > osg::ref_ptr<osg::Camera> camera1 = new osg::Camera; > camera1->setGraphicsContext(gc.get()); > camera1->setViewport(new osg::Viewport(traits->width / 2, 0, > traits->width, traits->height)); > buffer = GL_BACK_RIGHT; > camera1->setDrawBuffer(buffer); > > > // add this slave camera to the viewer, with a shift right of the > projection matrix > viewer.addSlave(camera1.get(), osg::Matrixd::translate(params), > osg::Matrixd()); > > // > =========================================================================================== > > > > > Since i do not have the hardware at my home, i cannot test the code here. > Could anyone please tell me if the code is alright? > > > Thank you! > > Cheers, > Mukund > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=37962#37962 > > > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org