[osg-users] Strange behaviour - no explanation
Lionel Lagarde
lionel.lagarde at oktal-se.fr
Wed Jan 24 23:49:19 PST 2018
Hi,
The geometry state set is probably shared among several nodes.
You should clone the state set before setting the polygon mode:
if (geometry->getStateSet() &&
geometry->getStateSet()->getParents().size() > 1)
{
geometry->setStateSet(new osg::StateSet(*geometry->getStateSet()));
}
geometry->getOrCreateStateSet()->setAttribute(new
osg::PolygonMode(osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::LINE));
On 24/01/2018 18:04, Werner Modenbach wrote:
> Hi all,
>
> I import a 3DS model and after import it shows me a flat structure of
> geodes:
>
> Final OSG node structure looks like this:
>
> Group
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geometry
>
> Geode
>
> Geometry
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geometry
>
> Geometry
>
> Geometry
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geometry
>
> Geometry
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geometry
>
> Geode
>
> Geometry
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geometry
>
> Geometry
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geometry
>
> Geometry
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
> Geometry
>
> Geode
>
> Geometry
>
> Geode
>
> Geometry
>
>
> I do a pick with a LineSegmentIntersector.
> The Interesections array contains 1 hit.
> It is a geometry and has 1 parent - the geode.
> I want this geometry to show in line mode.
> geometry->getOrCreateStateSet()->setAttribute(newosg::PolygonMode(osg::PolygonMode::FRONT_AND_BACK,osg::PolygonMode::LINE));
>
> But many geometries show up in line mode.
> I wrote a check NodeVisitor and this visitor finds many geometries
> being set to LineMode.
> I wrote another visitor which explicitely disables linemode on all
> geometries after loading of the model:
> geometry->getOrCreateStateSet()->setMode(osg::StateAttribute::POLYGONMODE,osg::StateAttribute::OFF);
> I already spent many hours on that but I'm running out of ideas.
>
> Any hint from someone in the list?
>
> Many thanks in advance
>
> - Werner -
>
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20180125/11b5b618/attachment.html>
More information about the osg-users
mailing list