Hello everyone, I have a problem with osg::Text()
Some letters seem to vanish with depth (see picture) - the "h" in "This is a label.." is vanishing if the text is further away from the camera.
Do you have any idea what I'm doing wrong?
This is how I draw the text node: (the font does not matter by the way...)
osg::ref_ptr<osg::StateSet> pStateset(new osg::StateSet()); pStateset->setMode(GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED | osg::StateAttribute::OVERRIDE); pStateset->setMode(GL_BLEND, osg::StateAttribute::ON); pStateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); pStateset->setRenderBinDetails(INT_MAX, "RenderBin", osg::StateSet::OVERRIDE_RENDERBIN_DETAILS); osg::ref_ptr<osgText::Text> pText( new osgText::Text ); osg::ref_ptr<osg::Geode> pTextGeode ( new osg::Geode ); pText->setFont(pFont); pText->setText(Text.c_str()); pText->setAutoRotateToScreen(true); pText->setDrawMode(osgText::Text::TEXT | osgText::Text::FILLEDBOUNDINGBOX); pText->setBoundingBoxMargin(FontSize * 0.1); pText->setFontResolution(96, 96); pText->setCharacterSize(FontSize); pText->setPosition(Position); pText->setColor(osg::Vec4d(1,0,0,1)); pText->setStateSet(pStateset.get()); pText->setUseDisplayList(false); pTextGeode->addDrawable(pText); pTextGeode->setStateSet(pStateset); return pTextGeode;
I'd be greatful for any help on the matter.-Tim-
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org