[osg-users] Predefined selectable edges with certain radius

Heiko Irrgang irrgang at wsoptics.de
Tue May 3 03:10:37 PDT 2016


i am trying to implement edge selection with osg.

What i have though, is not a simple 'every edge around every polygon is selectable' situation.

I have Faces built from several polygons and i want the outlines of these faces be selectable, not every edge of every polygon.

Now what i did first, is to use a linestrip for the outlines. This has good performance but it seems that LineSegmentIntersector does not see them, so they are not pickable. (is this correct, or did i do something wrong?)

Second i tried to use a number of osg::Cylinder objects, now they are pickable, but everything slowed down significantly as there are many cylinders and i did not see where i could specify the resolution of the cylinder. Another bad effect of this, is that obviously the 'lines' (aka cylinders) zoom with the camera view. So if you zoom in a lot, the edges get huge, if you zoom out far, you don't see them anymore.

So what i want is a mixture of both... optically i want single lines, but on selection, i want the user not to have to hit the exact pixel of the line to count as selected, but have some picking area around the lines (ideally adjusting to camera zoom, so the area gets not huge when zoomed in).

What be the osg way to achieve this?


Thank you!


Read this topic online here:

More information about the osg-users mailing list