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

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Fri Sep 15 03:48:06 PDT 2017



Hi Antoine,
> Hello Sebatian,
> 
> I was finally able to test your suggestion and it does work fine except that it does return the primitives, not the vertices composing the primitives (triangles for me).
> 
> Of course you can retrieve the vertices from the primitives (which I am currently doing), but selecting primitives and selecting vertices is not exactely the same.
Simply use the Intersection::indexList. It contains the vertex 
indices.The intersection has really all you'll ever need to select the 
contributing vertices. See the osg-CookBook for a reference example.
> 
> What I understand is that if I want to draw triangles but select exact vertices then I need to handle 2 different geometries, one with triangles for drawing and one with points for selection (and using your suggested technique with masks). Is that right?

No, you can use one graph and use a Polytope-intersector since 
point-line collisions are rare to practically impossible. I simply 
wanted to show an alternative, when using different pick/render-geometries.

Cheers
Sebastian

> 
> PS: at the time being I can live with the primitives / vertices approximation, but I want to get to the bottom of it eventually.
> 
> Kind regards,
> 
> Antoine.
> 
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71724#71724
> 
> 
> 
> 
> 
> _______________________________________________
> 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