Changeset 7019

Show
Ignore:
Timestamp:
06/23/07 13:21:54 (6 years ago)
Author:
robert
Message:

Added setting of the Camera's projection matrix to fit the windowing aspect ratio.

Location:
OpenSceneGraph/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgspheresegment/osgspheresegment.cpp

    r6941 r7019  
    659659 
    660660    // construct the viewer. 
    661     osgViewer::Viewer viewer; 
     661    osgViewer::Viewer viewer(arguments); 
    662662 
    663663    // if user request help write it out to cout. 
  • OpenSceneGraph/trunk/examples/osgviewerFLTK/osgviewerFLTK.cpp

    r6941 r7019  
    103103            { 
    104104                getCamera()->setViewport(new osg::Viewport(0,0,w,h)); 
     105                getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast<double>(w)/static_cast<double>(h), 1.0f, 10000.0f); 
    105106                getCamera()->setGraphicsContext(getGraphicsWindow()); 
    106107                setThreadingModel(osgViewer::Viewer::SingleThreaded); 
  • OpenSceneGraph/trunk/examples/osgviewerQT/osgviewerQT.cpp

    r6946 r7019  
    148148            getCamera()->setViewport(new osg::Viewport(0,0,width(),height())); 
    149149            getCamera()->setGraphicsContext(getGraphicsWindow()); 
     150            getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast<double>(width())/static_cast<double>(height()), 1.0f, 10000.0f); 
     151 
    150152            setThreadingModel(osgViewer::Viewer::SingleThreaded); 
    151153 
  • OpenSceneGraph/trunk/src/osgViewer/Viewer.cpp

    r7017 r7019  
    826826    osgViewer::GraphicsWindowEmbedded* gw = new osgViewer::GraphicsWindowEmbedded(x,y,width,height); 
    827827    getCamera()->setViewport(new osg::Viewport(0,0,width,height)); 
     828    getCamera()->setProjectionMatrixAsPerspective(30.0f, static_cast<double>(width)/static_cast<double>(height), 1.0f, 10000.0f); 
    828829    getCamera()->setGraphicsContext(gw); 
    829830    return gw;