[osg-users] Problems with osgFX::Outline node
Gianni Ambrosio
g.ambrosio+osg at gmail.com
Wed Aug 17 09:21:09 PDT 2016
Hi All,
I found at least two problems related to osgFX::Outline.
First of all, turning off lightning on a child node then the outline seems inheriting that option.
Here is basically the code:
Code:
void ControlPoints::insertMarker(size_t iIndex, const viframework::vimath::Point<double>& iPoint)
{
osg::ref_ptr<osg::AutoTransform> transform = new osg::AutoTransform();
transform->setAutoRotateMode(osg::AutoTransform::ROTATE_TO_SCREEN);
transform->setAutoScaleToScreen(true);
transform->setMinimumScale(0.0);
transform->setMaximumScale(FLT_MAX);
transform->setPosition(osg::Vec3(iPoint.x(), iPoint.y(), iPoint.z()));
transform->addChild(buildFlagWithOutlineEffect(30.0));
root->addChild(transform);
viroad::viosg::SceneManager::instance().setDirty();
}
osg::Node* ControlPoints::buildFlagWithOutlineEffect(float height)
{
osgFX::Outline* outline = new osgFX::Outline;
outline->setWidth(5);
outline->setColor(osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f));
Flag* flag = new Flag(height);
//flag->getOrCreateStateSet()->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
outline->addChild(flag);
return outline;
}
In attachment you can see the different behaviour.
I would like to disable lightning on the flag but have a red outline.
About the second problem I will open a different topic.
Cheers,
Gianni
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68407#68407
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lightning_on.png
Type: image/png
Size: 1392 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160817/ad6a9dec/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lightning_off.png
Type: image/png
Size: 1569 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160817/ad6a9dec/attachment-0005.png>
More information about the osg-users
mailing list