diff --git a/examples/osgspheresegment/osgspheresegment.cpp b/examples/osgspheresegment/osgspheresegment.cpp index 914635493..c56858ab5 100644 --- a/examples/osgspheresegment/osgspheresegment.cpp +++ b/examples/osgspheresegment/osgspheresegment.cpp @@ -658,7 +658,7 @@ int main(int argc, char **argv) // construct the viewer. - osgViewer::Viewer viewer; + osgViewer::Viewer viewer(arguments); // if user request help write it out to cout. unsigned int testCase = 0; diff --git a/examples/osgviewerFLTK/osgviewerFLTK.cpp b/examples/osgviewerFLTK/osgviewerFLTK.cpp index b7d441bcb..e43e9d539 100644 --- a/examples/osgviewerFLTK/osgviewerFLTK.cpp +++ b/examples/osgviewerFLTK/osgviewerFLTK.cpp @@ -102,6 +102,7 @@ class ViewerFLTK : public osgViewer::Viewer, public AdapterWidget AdapterWidget(x,y,w,h,label) { getCamera()->setViewport(new osg::Viewport(0,0,w,h)); + getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast(w)/static_cast(h), 1.0f, 10000.0f); getCamera()->setGraphicsContext(getGraphicsWindow()); setThreadingModel(osgViewer::Viewer::SingleThreaded); } diff --git a/examples/osgviewerQT/osgviewerQT.cpp b/examples/osgviewerQT/osgviewerQT.cpp index 67ba16835..01999d8b1 100644 --- a/examples/osgviewerQT/osgviewerQT.cpp +++ b/examples/osgviewerQT/osgviewerQT.cpp @@ -147,6 +147,8 @@ class ViewerQT : public osgViewer::Viewer, public AdapterWidget { getCamera()->setViewport(new osg::Viewport(0,0,width(),height())); getCamera()->setGraphicsContext(getGraphicsWindow()); + getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast(width())/static_cast(height()), 1.0f, 10000.0f); + setThreadingModel(osgViewer::Viewer::SingleThreaded); connect(&_timer, SIGNAL(timeout()), this, SLOT(updateGL())); diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 8ed1b4f4b..50b039da9 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -825,6 +825,7 @@ GraphicsWindowEmbedded* Viewer::setUpViewerAsEmbeddedInWindow(int x, int y, int setThreadingModel(SingleThreaded); osgViewer::GraphicsWindowEmbedded* gw = new osgViewer::GraphicsWindowEmbedded(x,y,width,height); getCamera()->setViewport(new osg::Viewport(0,0,width,height)); + getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast(width)/static_cast(height), 1.0f, 10000.0f); getCamera()->setGraphicsContext(gw); return gw; }