[osg-users] mygui integration (for Wang Rui)
Trajce Nikolov NICK
trajce.nikolov.nick at gmail.com
Wed Jun 8 15:03:16 PDT 2016
cool !
:)
Nick
On Wed, Jun 8, 2016 at 11:51 PM, Nickolai Medvedev <raizel.dev at yandex.ru>
wrote:
> 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
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
--
trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160609/6df2be70/attachment-0003.htm>
More information about the osg-users
mailing list