<div dir="ltr"><div><div><div><div><div><br>We've run into a very similar issue recently, with hundreds of inividually movable objects in a scene.<br><br></div>Our ugly workaround was to require a modifier key, e.g. Alt to be pressed if one really intended to move<br></div>an object. So at least the camera controls when not pressing the modifier remained smooth.<br></div><br></div>I would also be very interested in seeing some optimization to the way draggers compute their intersections. <br><br></div><div>Greetings,<br></div><div><br></div> Christian<br><br><div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-05-06 18:49 GMT+02:00 Jaap Glas <span dir="ltr"><<a href="mailto:jaap.glas@dgbes.com" target="_blank">jaap.glas@dgbes.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all,<br>
<br>
I am an employee of dGB Earth Sciences, and we use OpenSceneGraph for<br>
the 3D visualization of our open-source seismic interpretation package<br>
OpendTect.<br>
<br>
Our scenes may sometimes contain hundreds to thousands of draggers, mostly<br>
Translate(1D/2D)Draggers. We found that mouse clicking in the scene becomes<br>
very slow in that case. It turns out that every OSG dragger tries to intersect<br>
the line from camera eye to mouse position with all objects in the scene in<br>
order to produce its private list of intersections:<br>
<br>
[osgManipulator/Dragger.cpp:371]<br>
if ( view->computeIntersections(ea ,intersections,_intersectionMask) )<br>
<br>
My question is whether this is really necessary? I don't see (yet) why<br>
this list cannot be calculated only once and shared by all OSG draggers.<br>
Or alternatively, only calculated for draggers that are located under the<br>
mouse pointer.<br>
<br>
Our current workaround consists of derived dragger classes that overload<br>
the Dragger::traverse(.) function to test this latter alternative in advance,<br>
passing the current node path as an extra parameter:<br>
<br>
if ( !view->computeIntersections(*ea,nv.getNodePath(),intersections,<br>
_intersectionMask) ) continue;<br>
<br>
This reduces the computational order of mouse clicking from quadratic to<br>
linear with the number of draggers in the scene. And mouse clicking in the<br>
scene can be done again without huge delay.<br>
<br>
However, the question is whether such a shortcut would apply in the general<br>
case. Why is the osgManipulator::Dragger class doing this the way it does?<br>
<br>
<br>
Best regards,<br>
<br>
Jaap Glas<br>
<br>
<br>
-- dr Jaap C. Glas<br>
-- Software Engineer<br>
-- dGB Earth Sciences<br>
-- Phone: +31 53 435155<br>
-- Email:<br>
-- Internet: <a href="http://dgbes.com" target="_blank">dgbes.com</a> & <a href="http://opendtect.org" target="_blank">opendtect.org</a><br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=63651#63651" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=63651#63651</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br></div>