[osg-users] Picking Polygons?

Robert Osfield robert.osfield at gmail.com
Sun Mar 29 02:52:45 PDT 2009


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 <martinscheffler at googlemail.com>

> 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
> 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/20090329/14fe804b/attachment-0003.htm>


More information about the osg-users mailing list