Hi Martin,

The primitive index is the number of the triangle that has been processed in
the geometry starting at the first PrimitiveSet.  If the primitive type of
polygon then the intersection routines decompose this polygon into triangles
to do the intersection, and it's these triangles that are counted in the
intersection routines.

Robert.

2009/3/28 Martin Scheffler <[email protected]>

> Hi all,
>
> I have a geometry containing a number of polygons, each a
> osg::DrawElementsUInt(osg::PrimitiveSet::POLYGON,0).
>
> I want to use the LineSegmentIntersector to pick a polygon of the mesh.
> Everything works fine, only I can't make sense
> of the primitiveIndex value of the Intersection class.
>
> When I pick my mesh, I get these values:
>
> Intersection.IndexList: 118, 64, 67
> Intersection.PrimitiveIndex: 142
> Geometry.NumPrimitiveSets: 66
>
> So the picked PrimitiveIndex is 142, but there are only 66 polygons in the
> mesh!
> How can I get to the polygon?
>
> Thank you!
> Martin
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to