I used the following code to paint the text in the scene when the mark is 
detected:

osgText::Text* tankLabel = new osgText::Text();
osg::Geode* tankLabelGeode = new osg::Geode();
tankLabel->setCharacterSize(20);
tankLabel->setFont("../arial.ttf");
tankLabel->setText("text that i want to show");
                        tankLabel->setAxisAlignment(osgText::Text::SCREEN);
                                tankLabel->setDrawMode(osgText::Text::TEXT |
                            osgText::Text::ALIGNMENT | 
                                osgText::Text::BOUNDINGBOX);

                                
tankLabel->setAlignment(osgText::Text::CENTER_TOP);
tankLabel->setPosition( osg::Vec3(-40,-80,-590) );
tankLabel->setColor(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
tankLabelGeode->addDrawable(tankLabel);
OSG::GetRootNode()->addChild(tankLabelGeode);  


To delete the same text I've tried the following code but it's not working for 
me:

osg::ClearNode* clearNode = new osg::ClearNode;
clearNode->addChild(tankLabelGeode);


How can I hide the nodemask ?

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=47503#47503





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to