<div dir="ltr">Thanks Julien for your time to give it a look<div><br></div><div>I went further, debugging view->computeIntersections(). The osgpick is my starting point and my code is only a mimic of what osgViewer::View::computeIntersection is doing, using the IntersectionVisitor</div><div><br></div><div>A good sample for reproduction is to have some code (I will post it here soon) that will load two models (terrain and building - can be the lz.osg and the cow.osg from the dataset) place the model somewhere on the terrain and rotate the root (the terrain) a bit, and use the osgpick sample. This is fast that come to me minds now, although it might not work the same since picking from the screen coords and picking in "world space" have different CoordinateFrames for the LineSegmentIntersector used that is managed differently</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 18, 2017 at 9:33 PM, Julien Valentin <span dir="ltr"><<a href="mailto:julienvalentin51@gmail.com" target="_blank">julienvalentin51@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi nick<br>
At first glance, I don't see any problem with your code...<br>
If you just want to code a mousepicker<br>
osgViewer::View::<wbr>computeIntersections(screenx,<wbr>screeny,outintersections))<br>
 would fit your needs.<br>
<br>
Code:<br>
// class to handle events with a pick<br>
class PickHandler : public osgGA::GUIEventHandler<br>
{<br>
public:<br>
bool PickHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)<br>
{<br>
    switch(ea.getEventType())<br>
    {<br>
    case(osgGA::GUIEventAdapter::<wbr>DOUBLECLICK):<br>
    {<br>
        osgViewer::View* view = dynamic_cast<osgViewer::View*><wbr>(&aa);<br>
        if (view){<br>
osgUtil::<wbr>LineSegmentIntersector::<wbr>Intersections inter;<br>
if(view->computeIntersections(<wbr>ea.getX(),ea.gety(),inter){<br>
...blablabla...<br>
}<br>
}<br>
}<br>
<br>
<br>
<br>
<br>
Perhaps you should try it before debugging deeper<br>
<br>
Further, I would recommend the polytopeintersector for general purpose picking (it works for points primitives too)<br>
<br>
Hope it helps<br>
<br>
<br>
Cheers<br>
<span class=""><br>
<br>
<br>
Trajce Nikolov NICK wrote:<br>
> It has to do with MatrixTransforms and probably the IntersectionVisitor. I had my scene rotated a bit and it was buggy. With identity matrix on top works well ... Trying to debug if I can find something<br>
><br>
</span><span class="">> On Thu, Feb 16, 2017 at 8:31 PM, Trajce Nikolov NICK < ()> wrote:<br>
><br>
> > Hi Community,<br>
> ><br>
> > I am experiencing some bad results from various intersection tests. I have a database with buildings and for some reason the intersection tests are failing to get me the roofs of the buildings ...<br>
> ><br>
> ><br>
> > Here some snippets of my tries:<br>
> ><br>
> ><br>
</span>> > <a href="http://pastebin.com/s7aZk8wA" rel="noreferrer" target="_blank">http://pastebin.com/s7aZk8wA</a> (<a href="http://pastebin.com/s7aZk8wA" rel="noreferrer" target="_blank">http://pastebin.com/s7aZk8wA</a>)<br>
> ><br>
> > <a href="http://pastebin.com/1s99SGZc" rel="noreferrer" target="_blank">http://pastebin.com/1s99SGZc</a> (<a href="http://pastebin.com/1s99SGZc" rel="noreferrer" target="_blank">http://pastebin.com/1s99SGZc</a>)<br>
> ><br>
> > <a href="http://pastebin.com/UtkqPRce" rel="noreferrer" target="_blank">http://pastebin.com/UtkqPRce</a> (<a href="http://pastebin.com/UtkqPRce" rel="noreferrer" target="_blank">http://pastebin.com/UtkqPRce</a>)<br>
<span class="">> ><br>
> ><br>
> ><br>
> > What I am missing here?<br>
> ><br>
> ><br>
> > Thanks for every hint as always!<br>
> > Cheers!<br>
> ><br>
> > --<br>
> > trajce nikolov nick<br>
> ><br>
> ><br>
> ><br>
> ><br>
><br>
><br>
><br>
><br>
> --<br>
> trajce nikolov nick<br>
><br>
</span>>  ------------------<br>
> Post generated by Mail2Forum<br>
<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=70269#70269" rel="noreferrer" target="_blank">http://forum.openscenegraph.<wbr>org/viewtopic.php?p=70269#<wbr>70269</a><br>
<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">trajce nikolov nick<br></div>
</div>