[osg-users] Why does osg::AutoTransform node disappear when the scene is first created?

mirr...@gmail.com mirro187 at gmail.com
Sun Mar 7 21:08:50 PST 2021


   evn is win10&osg3.6.4 

   Why does osg::AutoTransform disappears after using the set 
setAutoRotateMode           method to be  true .  
    //
    std::string timesFont("fonts/arial.ttf");
    osgText::Text* text = new osgText::Text;
    text->setCharacterSize(characterSize);
    text->setText(message);
    text->setFont(timesFont);
    text->setAlignment(osgText::Text::CENTER_CENTER);

    osg::Geode* geode = new osg::Geode;
    geode->addDrawable(text);
    geode->getOrCreateStateSet()->setMode(GL_LIGHTING, 
osg::StateAttribute::OFF);

    osg::AutoTransform* at = new osg::AutoTransform;
    at->addChild(geode);

    at->setAutoRotateMode(osg::AutoTransform::ROTATE_TO_SCREEN);
    at->setAutoScaleToScreen(true);
    at->setMinimumScale(minScale);
    at->setMaximumScale(maxScale);
    at->setPosition(position);

[image: QQ图片20210308125825.jpg] 

-- 
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/1ac85395-3e28-43b7-97c2-ac400d782a40n%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20210307/1d8829da/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QQ??20210308125825.jpg
Type: image/jpeg
Size: 436270 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20210307/1d8829da/attachment-0001.jpg>


More information about the osg-users mailing list