[osg-users] osgViewer::Viewer and getSceneView

David Callu ledocc at gmail.com
Wed Oct 10 16:05:21 PDT 2007


Hi Pasquale

  now you need to use the osgViewer::Viewer
   which derive from osgViewer::View
   which derive from osg::View

 You have access to
   - the scene graph by osgViewer::View::GetScene()
   - the camera by osgViewer::View::GetCamera()
   ...

 osgUtil::SceneView is use internally  by osgViewer in osgViewer::Renderer.
And inherited its setting form the camera that osgViewer::Renderer render.
this is done in osgViewer::Renderer::updateSceneView.

 HTH
David

2007/10/11, Pasquale Tricarico <tricaric at gmail.com>:
>
> Hi,
>
> I'm updating a project to OSG-2.2, after several months (~6) of
> interrupted development, and I'm facing a problem. Before I based my
> code on the QT viewer example, with:
>
> class ViewerQT : public osgViewer::Viewer, public GraphicsWindowQT {...}
>
> and I could do:
>
> ViewerQT * viewerWindow = new ViewerQT;
> viewerWindow->getSceneView()->...;
>
> Now, I've updated my code using the latest osgviewerQT example, where:
>
> class AdapterWidget : public QGLWidget {...}
>
> class ViewerQT : public osgViewer::Viewer, public AdapterWidget {...}
>
> but now ViewerQT doesn't provide the getSceneView() method. How can I
> recover it? I needed it mainly to modify the near/far ratio:
>
> ...->getSceneView()->setNearFarRatio(1.0e-8); // big scene, with many
> tiny important details that need to be rendered
>
> and for debugging/verbose output such as:
>
> ...->getSceneView()->getProjectionMatrixAsPerspective(fovy,
> aspectRatio, zNear, zFar);
>
> Maybe now OSG 2.2 offers better ways to perform these two tasks?
>
> Thanks a lot,
> Pasquale
>
> (BTW, the first line of osgviewerQT.cpp says "OpenSceneGraph example,
> osganimate.", got to love cut'n'paste ;)
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071011/7ca01abb/attachment-0003.htm>


More information about the osg-users mailing list