[osg-users] Outlining a node (Beginner)

Julien Valentin julienvalentin51 at gmail.com
Mon Jan 15 08:39:33 PST 2018


Hi Lex
I'm afraid the community knowledge around this feature began to fade with time...
Personnaly I avoid using old parts of osg (osgFX and osgParticle for ex) because a lot of techniques used in its features have evolved in a way that new hardware are not fitted anymore to them.

Perhaps asking the original contributor of OutLine directly could be your best bet

https://github.com/uhertlein

Cheers


lex wrote:
> Hi,
> 
> I've had a look at my code and I've come up with this updated method of adding the outline, which works for a certain part of my robot, in this case the drawable of the UpperArm, however I'm still experiencing the same issue of flickering on and off when I try and use it. 
> 
> Any help would be appreciated :D
> 
> 
> Code:
> findNodeVisitor upperArm("UpperArmRotator"); 
> wholeModel->accept(upperArm); 
> 
> osgFX::Outline* upperArmOutline = new osgFX::Outline();
> upperArmOutline->setWidth(100); //in an attempt to see it better
> upperArmOutline->setColor(osg::Vec4(1, 1, 0, 1));
> 
> osg::Node* upperArmDrawable = upperArm.getFirst()->asGroup()->getChild(1);
> 
> upperArmOutline->addChild(upperArmDrawable);
> upperArm.getFirst()->asGroup()->replaceChild(upperArm.getFirst()->asGroup()->getChild(1), upperArmOutline);
> 
> 
> 
> 
> 
> Thank you!
> 
> Cheers,
> Lex


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72760#72760







More information about the osg-users mailing list