<div dir="ltr"><div>I want to set the font of the axes labels(X,Y,Z) using GUI so I traverse through the scenegraph, to access the axis labels(X,Y,Z) which are text3D nodes. The function getLabelText3D(..) returns the drawables as text3D and later set the font of the drawable  by setFont() but the font style only gets applied on X label but not Y,Z. Now how do I access the remaining drawables.</div><div><br></div><div><br></div><div>osgText::Text3D* AxesNode::getLabelText3D(::osg::Node* axes)<br>    {<br>       
 osg::Switch *switch_node = getLabelSwitch(axes);   // returns the 
switch node which has the Geode to which X,Y,Z text3D nodes are added as
 drawables.<br>        if(!switch_node)<br>        {<br>            return NULL;<br>        }<br><br>        osg::Node* node = switch_node->getChild(0);<br>        osg::Geode* geode_node = node->asGeode();<br>        if(geode_node && geode_node->getNumDrawables() > 1)<br>        {<br>            for(osg::Drawable* drawable : geode_node->getDrawableList())<br>            {<br>               
 osgText::Text3D* text = 
dynamic_cast<osgText::Text3D*>(drawable);  //here I have three 
drawables X,Y,Z but the function only returns X drawable<br>                if(text)<br>                {<br>                    return text;<br>                }<br>            }<br>        }<br>        return NULL;<br>    }</div><div><br></div><div><br></div><div><br></div><div>void Vizkit3DWidget::setFont(....)<br>{<br>      <br>      osg::Node *node = FindNode::find(*getRootNode(),"axes_node");<br>         <br>        osgText::Text3D*  text3d = AxesNode::getLabelText3D(switch_node->getChild(0));<br>    <br>        text3d->setFont(font_d.get());                //only sets font for X label, no effect on Y,Z label<br> </div><div> emit propertyChanged("font");<br>}</div><div><br></div><div><br></div><div> </div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:osg-users+unsubscribe@googlegroups.com">osg-users+unsubscribe@googlegroups.com</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/osg-users/3f457cd4-2760-45a9-a376-361612aa312f%40googlegroups.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/osg-users/3f457cd4-2760-45a9-a376-361612aa312f%40googlegroups.com</a>.<br />