[osg-users] different materials for a geometry and highlight

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Mon Sep 19 01:50:12 PDT 2016


Hi Gianni,
> Code:
> osg::Geometry* buildGeometry() {
>         osg::Geometry* geometry = new osg::Geometry;
>         geometry->setVertexArray(buildVertices());
>         geometry->setColorArray(buildColors(), osg::Array::BIND_PER_PRIMITIVE_SET);
>
>         std::vector<osg::DrawElementsUInt*> elements = buildElements();
>         for (std::vector<osg::DrawElementsUInt*>::iterator i = elements.begin(); i != elements.end(); ++i) {
>           geometry->addPrimitiveSet(*i);
>         }
>
>         return geometry;
> }
>
>
>
> When I pick a triangle, is there a way from the information stored into a osgUtil::LineSegmentIntersector::Intersection to get the related primitive set?
I might be wrong, but I think the intersector.primitiveIndex might yield 
the number you are looking for
Also be sure to handle all intersections returned.

Cheers
Sebastian
>
> Regards,
> Gianni
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=68630#68630
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




More information about the osg-users mailing list