diff --git a/src/osg/DisplaySettings.cpp b/src/osg/DisplaySettings.cpp index 8c0f3687c..c85c6986f 100644 --- a/src/osg/DisplaySettings.cpp +++ b/src/osg/DisplaySettings.cpp @@ -88,10 +88,10 @@ void DisplaySettings::setDefaults() _screenHeight = 0.26f; _splitStereoHorizontalEyeMapping = LEFT_EYE_LEFT_VIEWPORT; - _splitStereoHorizontalSeparation = 42; + _splitStereoHorizontalSeparation = 0; _splitStereoVerticalEyeMapping = LEFT_EYE_TOP_VIEWPORT; - _splitStereoVerticalSeparation = 42; + _splitStereoVerticalSeparation = 0; _doubleBuffer = true; _RGB = true; diff --git a/src/osgUtil/SceneView.cpp b/src/osgUtil/SceneView.cpp index eec2c989b..6f7ffac2c 100644 --- a/src/osgUtil/SceneView.cpp +++ b/src/osgUtil/SceneView.cpp @@ -305,6 +305,7 @@ void SceneView::cull() (*projection)); + osg::ref_ptr modelviewLeft = new osg::RefMatrix( (*modelview) * osg::Matrix(1.0f,0.0f,0.0f,0.0f, 0.0f,1.0f,0.0f,0.0f, @@ -328,6 +329,21 @@ void SceneView::cull() 0.0f,0.0f,1.0f,0.0f, -es,0.0f,0.0f,1.0f)); + switch(_displaySettings->getStereoMode()) + { + case(osg::DisplaySettings::HORIZONTAL_SPLIT): + (*projectionLeft).postMult(osg::Matrix::scale(2.0f,1.0f,1.0f)); + (*projectionRight).postMult(osg::Matrix::scale(2.0f,1.0f,1.0f)); + break; + case(osg::DisplaySettings::VERTICAL_SPLIT): + (*projectionLeft).postMult(osg::Matrix::scale(1.0f,2.0f,1.0f)); + (*projectionRight).postMult(osg::Matrix::scale(1.0f,2.0f,1.0f)); + break; + default: + break; + } + + _cullVisitorRight->setTraversalMask(_cullMaskRight); cullStage(projectionRight.get(),modelviewRight.get(),_cullVisitorRight.get(),_rendergraphRight.get(),_renderStageRight.get());