I am facing the weird issue with the auto-transform. I have  two
auto-transforms one having  text and other having the

Icon. I put both the transforms  in the switch node and based on the mode
like

 

Icon

Text

Icon_text

 

I am switching the state of the switch node. But when I try to zoom in/zoom
out 5-6 times icon and the text 

Is getting disappeared. Sometimes when I go close to the node it comes and
sometimes it doesn't come at all

 

This is my code for getting the icon Transform

        if(!_iconTransform.valid())

        {

            _iconTransform = new osg::AutoTransform();

 

            _iconTransform->setAutoScaleToScreen(true);

 
_iconTransform->setAutoRotateMode(osg::AutoTransform::ROTATE_TO_SCREEN);

 

            _iconCullCallback = new indiUtil::IconCullCallback();

            _iconTransform->setCullCallback(_iconCullCallback.get());

                  _iconTransform->setDataVariance(osg::Object::DYNAMIC);

            

            if(_mode == ICON || _mode == ICON_AND_TEXT)

            {

                _switchNode->addChild(_iconTransform.get(), true);

            }

            else

            {

                _switchNode->addChild(_iconTransform.get(), false);

            }

        }

 

        return _iconTransform.get();

 

This is my code for the text transform

if(!_textTransform.valid())

        {

            _textTransform = new osg::AutoTransform();

 

            _textTransform->setAutoScaleToScreen(true);

 
_textTransform->setAutoRotateMode(osg::AutoTransform::ROTATE_TO_SCREEN);

 

            _textTransform->setCullCallback(new
indiUtil::IconCullCallback());

 

            _intializeText();

 

            if(_textTransform.get() && _textGeode.get())

            {

                _textTransform->addChild(_textGeode);

                if(_mode == IRepresentation::TEXT || _mode ==
IRepresentation::ICON_AND_TEXT)        

                    _switchNode->addChild(_textTransform.get(), true);


                else

                    _switchNode->addChild(_textTransform.get(), false);

 

                _placeTextNode();

            }

        }

        return _textTransform.get();

 

I tried a lot but not able to find out the reason. I thought it may be
bacause of the cullback that I installed but even when I am removing it, I
am getting the same issue.

 

Please help me out !!!

 

With Regards

Abhinav Goyal

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

Reply via email to