Hi Nelson,

The osgplanet example already does what you are after... it attaches
multiple NodeTrackerManipulators, one for each planet of interest,
then a KeySwitchMatrixManipulator is used at the top to select which
planet to view.  Please have a look at the code.

Robert.

On 8/11/07, Cysneros, Nelson SPAWAR <[EMAIL PROTECTED]> wrote:
>
>
> On the osgplanet example, if I wanted to view any selected planet and have
> it be my center of focus, while still being part of the overall simulation,
> what would be the best way to do this?
>
>
> 1.  Attach a camera to every planet, and when selected pass the camera to
> the main view.
>
>         osgViewer::Viewer viewer;
>         viewer->setSceneData(root);
>
>         //after selecting planet
>         viewer->setCamera(newPlanetCamera);
>
>
> 2. Point the default camera to the selected Planets
>
>          osg::Vec3 eye( viewPoint->getX(), viewPoint->getY(),
> viewPoint->getZ());
>          osg::Vec3 center(0,0,0);
>          osg::Vec3 up(0,0,5000000);
>
> viewer->getCamera()->setViewMatrixAsLookAt(eye,center,up);
>
>
> 3. Is their a better way to do this?  Any examples?
>
>
>
> Thank you
>
> _______________________________________________
> 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