Make stereo modes work again

Be aware that stereo rendering based on SoRenderManager does not allow background colors as the opengl buffers are cleared before rendering. As FreeCAD draws the background before the standart coin rendering the background gets erased again.
This commit is contained in:
Stefan Tröger 2014-09-28 19:06:44 +02:00 committed by wmayer
parent ac010de9c9
commit 4e63e11df6
2 changed files with 6 additions and 6 deletions

View File

@ -566,23 +566,23 @@ bool View3DInventor::onMsg(const char* pMsg, const char** ppReturn)
return true;
}
else if(strcmp("SetStereoRedGreen",pMsg) == 0 ) {
_viewer->setProperty("StereoMode", Quarter::SoQTQuarterAdaptor::ANAGLYPH);
_viewer->setStereoMode(Quarter::SoQTQuarterAdaptor::ANAGLYPH);
return true;
}
else if(strcmp("SetStereoQuadBuff",pMsg) == 0 ) {
_viewer->setProperty("StereoMode", Quarter::SoQTQuarterAdaptor::QUAD_BUFFER );
_viewer->setStereoMode(Quarter::SoQTQuarterAdaptor::QUAD_BUFFER );
return true;
}
else if(strcmp("SetStereoInterleavedRows",pMsg) == 0 ) {
_viewer->setProperty("StereoMode", Quarter::SoQTQuarterAdaptor::INTERLEAVED_ROWS );
_viewer->setStereoMode(Quarter::SoQTQuarterAdaptor::INTERLEAVED_ROWS );
return true;
}
else if(strcmp("SetStereoInterleavedColumns",pMsg) == 0 ) {
_viewer->setProperty("StereoMode", Quarter::SoQTQuarterAdaptor::INTERLEAVED_COLUMNS );
_viewer->setStereoMode(Quarter::SoQTQuarterAdaptor::INTERLEAVED_COLUMNS );
return true;
}
else if(strcmp("SetStereoOff",pMsg) == 0 ) {
_viewer->setProperty("StereoMode", Quarter::SoQTQuarterAdaptor::MONO );
_viewer->setStereoMode(Quarter::SoQTQuarterAdaptor::MONO );
return true;
}
else if(strcmp("Example1",pMsg) == 0 ) {

View File

@ -1046,7 +1046,7 @@ Py::Object View3DInventorPy::setStereoType(const Py::Tuple& args)
if (stereomode < 0 || stereomode > 4)
throw Py::Exception("Out of range");
Quarter::SoQTQuarterAdaptor::StereoMode mode = Quarter::SoQTQuarterAdaptor::StereoMode(stereomode);
_view->getViewer()->setProperty("StereoMode",mode);
_view->getViewer()->setStereoMode(mode);
return Py::None();
}
catch (const Base::Exception& e) {