[osg-users] mygui integration (for Wang Rui)
Nickolai Medvedev
raizel.dev at yandex.ru
Wed Jun 8 14:51:18 PDT 2016
The problem is solved! It is necessary to setup the camera and Geode:
geode->setCullingActive( false );
geode->addDrawable( mygui.get() );
geode->getOrCreateStateSet()->setMode( GL_BLEND, osg::StateAttribute::ON );
geode->getOrCreateStateSet()->setRenderingHint( osg::StateSet::TRANSPARENT_BIN );
geode->getOrCreateStateSet()->setRenderBinDetails(1000,"RenderBin");
osg::ref_ptr<osg::Camera> camera = new osg::Camera;
camera->setReferenceFrame( osg::Transform::ABSOLUTE_RF );
camera->setRenderOrder( osg::Camera::POST_RENDER );
camera->setAllowEventFocus( false );
camera->setProjectionMatrix( osg::Matrix::ortho2D(0.0, 1.0, 0.0, 1.0) );
camera->addChild( geode.get() );
camera->setClearMask(0);
root->addChild( camera.get() );
viewer.addEventHandler( new MYGUIHandler( camera.get(), mygui.get()) );
Cheers,
Nickolai[/code]
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=67514#67514
More information about the osg-users
mailing list