[osg-users] switch between two camera

Lingyun Yu lingyun.yu.06 at gmail.com
Fri Mar 20 09:26:46 PDT 2009


Hi ben,

where did you put your code? I put them in the updatecallback function,
that's why mine will change every frame.

Yun

2009/3/20 Ben <ben.poulard at gmail.com>

>
> benbao wrote:
> > I try to use nodemask but doesn't work.
> > Id do this :
> > Code:
> >
> > osgViewer::CompositeViewer viewer;
> > osgViewer::GraphicsWindowEmbedded* gw = new
> osgViewer::GraphicsWindowEmbedded;
> >
> > osgViewer::View* vue2D = new osgViewer::View;
> > osgViewer::View* vue3D = new osgViewer::View;
> > viewer.addView(vue2D);
> > viewer.addView(vue3D);
> >
> > vue2D->getCamera()->setGraphicsContext(gw );
> > vue2D->getCamera()->setProjectionMatrixAsPerspective(30.0f,
> width()/(double) height(), 1.0, 1000.0);
> > vue2D->getCamera()->setViewport(new osg::Viewport(0,0,width(),height()
> ));
> > vue2D->setCameraManipulator(new osgGA::TrackballManipulator);
> >
> >
> > vue3D->getCamera()->setGraphicsContext(gw );
> > vue3D->getCamera()->setProjectionMatrixAsPerspective(30.0f,
> width()/(double) height(), 1.0, 1000.0);
> > vue3D->getCamera()->setViewport(new osg::Viewport(0,0,width(),height()
> ));
> > vue3D->setCameraManipulator(new osgGA::TrackballManipulator);
> >
> >
> >
> > Code:
> >
> > // to switch vue3D OFF and vue2D on
> > vue2D->getCamera()->setNodeMask(0XFFFFFFFF);
> > vue3D->getCamera()->setNodeMask(0);
> >
> >
> >
>
>
> sorry it's work, but only the view on top is updated by mouse manipulator.
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=8854#8854
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Cheers,
Yun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090320/ccc35baf/attachment-0003.htm>


More information about the osg-users mailing list