一、osgText::Text
void addLabelName(osg::MatrixTransform* mtplane, const wchar_t* str)
{
osgText::Text* text = new osgText::Text;
text->setPosition(osg::Vec3d(0,0,0));
osg::ref_ptr<osgText::Font> font = new osgText::Font();
//读取字体
font = osgText::readFontFile("fonts/simhei.ttf");
// 设置字体文件
text->setFont(font.get());
// 设置文字信息
text->setText(str);
//text->setCharacterSize(100.0);
text->setAlignment(osgText::Text::RIGHT_BOTTOM);
//文字一直面向镜头
text->setAxisAlignment(osgText::Text::SCREEN);
//设置大小随视角缩放模式
text->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);
//text->setCharacterSizeMode(osgText::Text::OBJECT_COORDS_WITH_MAXIMUM_SCREEN_SIZE_CAPPED_BY_FONT_HEIGHT);
osg::Geode* geode