Hi Martin,

Repeating the same question multiple times under different headings isn't
going to do you any favours, it just clogs up the mailing list/forum and
provides no clear thread for any discussion.

As for the answer to your question, the only way I can answer it
definitively would be to do a code review to see what exactly happens with
ABSOLUTE_RF would be encountered - you have the access to the OSG code so
there isn't aything stopping you stepping through the code for a definitive
explanation either.

Off the top of my head I don't think it'll work without some form of
caching of the original LineSegment in window coordinates and then
re-projecting, but I don't recall the
IntersectionVisitor/LineSegmentIntersector doing this - it's not a straight
forward workaround to putting absolute transforms in the scene graph.

If you are putting absolutely transforms in the scene graph then it way be
an indication that perhaps you should split up the scene graph so the
absolute subgraph is placed under it's own View or at least slave Camera up
at the viewer. This way the viewer can manage the different projection into
the subgraphs coordinates without any "clever" workarounds.

You don't say anything about why you are using an absolute transforms so
can't say whether the viewer level approach would be suitable.

Robert.

On 6 October 2014 19:34, Martin Ferry <[email protected]> wrote:

> Hi,
>
> I have graph with MatrixTransform as ABSOLUTE_RF and I can't pick node
> with this type of ref. It si posible pick this node ? or I am doing
> something wrong ?
>
> bool Picker::handle( const osgGA::GUIEventAdapter& ea,
> osgGA::GUIActionAdapter& aa )
> {
>         if (ea.getEventType()==osgGA::GUIEventAdapter::PUSH &&
>                 ea.getButton()==osgGA::GUIEventAdapter::LEFT_MOUSE_BUTTON )
>         {
>                 osgViewer::View* viewer =
> dynamic_cast<osgViewer::View*>(&aa);
>                 if ( viewer )
>                 {
>                         osg::ref_ptr<osgUtil::LineSegmentIntersector>
> intersector =
>                                 new
> osgUtil::LineSegmentIntersector(osgUtil::Intersector::WINDOW, ea.getX(),
> ea.getY());
>
>                         osgUtil::IntersectionVisitor iv( intersector.get()
> );
>
>                         viewer->getCamera()->accept( iv );
>
>                         if ( intersector->containsIntersections() )
>                         {
>
> osgUtil::LineSegmentIntersector::Intersection result =
> *(intersector->getIntersections().begin());
>                                 doUserOperations( result );
>                         }
>                 }
>         }
>         return false;
> }
> Thank you!
>
> Cheers,
> Martin
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=61253#61253
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to