[osg-users] Setting Camera View Matrix Not Taking Effect

OpenSceneGraph Users osg-users at lists.openscenegraph.org
Wed Apr 22 03:49:06 PDT 2020


On Wed, 22 Apr 2020 at 11:10, OpenSceneGraph Users <
osg-users at lists.openscenegraph.org> wrote:

> Worth pointing out that if you don’t want any camera manipulator, you can
> just call setCameraManipulator(NULL) on each of the Viewer’s views:
>
> Views views;
>     pViewer->getViews(views);
>     *for *(Views::iterator it = views.begin(); it != views.end(); it++) {
>         (*it)->setCameraManipulator(NULL);
>     }
>

The default TrackballManipulator is only added by the Viewer::run() method
when there are no other means for setting the view matrix, so if you don't
use the Viewer::run() convenience method and instead roll hour own frame
loop then you won't get the fallback TrackballManipulator being added.

To replace the viewer::run() usage all you have to do is:

  viewer.realize();
  while (!viewer.done())
  {
       viewer.frame();
  }

You can also break the viewer.frame() down into it's constituent parts.
Have a look at the Viewer::run(), frame() methods to demystify what's
happen in these convenience methods.

Cheers,
Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200422/43511dcf/attachment.html>


More information about the osg-users mailing list