Hi,
with
Code:
osg::ref_ptr<osgText::Text> label = new osgText::Text();
osg::ref_ptr<osg::Geode> labelGeode = new osg::Geode();
labelGeode->setName(TEXT_TOP);
labelGeode->addDrawable(label.get());
label->setCharacterSize(1.3);
label->setFont("arial.ttf");
label->setText(fileName);
label->setAxisAlignment(osgText::Text::XY_PLANE);
label->setDrawMode(osgText::Text::TEXT);
label->setAlignment(osgText::Text::CENTER_TOP);
label->setPosition( osg::Vec3(0.0f, 0.5f,6.05f) );
label->setColor(_textColorTop);
shapeGroup->addChild(labelGeode.get());
i write text on a geode. But when the geode is ovelayed with a transparent
geode the text disappears.
Code:
osg::ref_ptr<osg::Material> shapeMaterial = new osg::Material;
//rote Einfärbung
shapeMaterial->setDiffuse(osg::Material::FRONT_AND_BACK, osg::Vec4(1.0f, 0.0f,
0.0f, 1.0f));
shapeMaterial->setTransparency(osg::Material::FRONT_AND_BACK, 0.8f);
osg::ref_ptr<osg::StateSet> stateSet = new
osg::StateSet();
stateSet->setMode(GL_BLEND,
osg::StateAttribute::OVERRIDE | osg::StateAttribute::ON );
stateSet->setAttribute(shapeMaterial.get(),
osg::StateAttribute::OVERRIDE);
stateSet->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
shapeGeodeRZ->setStateSet(stateSet.get());
How can i stop the text from disappearing?
Thank you!
Cheers,
Andrew
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=35545#35545
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org