查看: 711|回复: 0

请教一个Text消失的问题.

[复制链接]

该用户从未签到

发表于 2019-2-21 12:29:20 | 显示全部楼层 |阅读模式
12.png

请教大家一个小问题,我做了一个小程序,为何文字老是消失(感觉低于垂直于平面0点则存在,否则则消失).而同是这个group中的别的东西则会存在.


代码如下


        osg::ref_ptr<osg::Geode> textgeode = new osg::Geode();
        osg::ref_ptr<osgText::TextBase> myText = new osgText::Text;
        myText->setDataVariance(osg::Object::STATIC);
        myText->setFontResolution(128.0f, 128.0f);
        myText->setPosition(p1);
        myText->setCharacterSize(txtSize);
        myText->setAxisAlignment(osgText::TextBase::SCREEN);
        myText->setCharacterSizeMode(osgText::TextBase::SCREEN_COORDS);
        myText->setAutoRotateToScreen(true);
        //osg::AutoTransform::AutoRotateMode autoMode;
        //annot->setAutoRotateToScreen(autoMode);
        myText->setText(text);
        myText->setColor(annotclr);
        if (font) myText->setFont(font);
        textgeode->addDrawable(myText);
        osg::ref_ptr<osg::Group> grp = new osg::Group;
        grp->addChild(textgeode);
您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表