[osg-users] Display one scene, pick from another one

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Fri Sep 8 04:57:56 PDT 2017


Hi Antoine,

> 
> I handle a scene which is very dense (~4M triangles) and displayed with triangles only (no line, nor points). I would like to select the vertices of this scene though (not the displayed triangles).
> 
> I thought of reusing the same osg::Geometry twice in the graph and with different states (PolygonMode::FILL and PolygonMode::POINT to name them).
> 
> 1) This does not seem to work, as I seem to still have triangles returned by the pick, not points
> 2) I need to swap osg::Geometry, just for the pick and I have not managed to find a way through

 From what you describe you don't need two scenes. The pick-reply will 
give you all information on the picked face (which vertex-indices, the 
intersection point) from which you can determine the vertex near to the 
picking point. (Picking vertices is almost impossible with a 
line-intersector anyways)

If you absolutely need two scene representations, you might consider 
using the TraversalMask and NodeMask, where you give the two scenes 
different NodeMasks at their roots and set the camera's and 
intersection-visitors traversal mask respectively.

HtH
Sebastian






> 
> Any idea?
> 
> Thanks a lot for reading (and if you can help, it is even better ;)).
> 
> Antoine.
> 
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71659#71659
> 
> 
> 
> 
> 
> _______________________________________________
> 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