[osg-users] PolytopeIntersector::Intersection::primitiveIndex

tom spencer blobfish at gmx.com
Sun May 28 19:19:29 PDT 2017

I am looking for some clarification of the primitiveIndex value of polytope intersection. I have added a very simple scene file containing 3 planar faces of a cube with 6 triangles in a primitive set.  I have been testing the polytope intersector with osgkeyboardmouse using the following command 
'osgkeyboardmouse --kdtree box_partial_work_1set.osgt'

 Running this command and hitting the 'p' key and then selecting the 2 triangles making up the red face I get the following output.

osgkeyboardmouse --kdtree box_partial_work_1set.osgt
Building KdTrees
ViewerBase::configureAffinity() numProcessors=4
  databasePagers = 1
_forceVertexArrayObject = 0
_forceVertexBufferObject = 0
Using PolytopeIntersector

PoltyopeIntersector traversal took 0.104ms
Picked 10 2.44399 1.97205
  Distance to ref. plane 4.928, max. dist 5.0417, primitive index 4, numIntersectionPoints 2
  Hits Geometry nodePath size 3
  parent Group

PoltyopeIntersector traversal took 0.034ms
Picked 10 7.93759 7.66585
  Distance to ref. plane 4.13599, max. dist 4.24392, primitive index 5, numIntersectionPoints 2
  Hits Geometry nodePath size 4
  parent Scribe

why are primitive indexes 4 and 5? Shouldn't they be 0 and 1 because those triangles are listed first in the scene file?

If I do the same procedure and leave off '--kdtree' I am getting indexes of 1 and 2.

Thank you!


Read this topic online here:


More information about the osg-users mailing list