[osg-users] Intersect Point Cloud wth precision

Chris Hanson xenon at alphapixel.com
Fri Dec 23 20:08:40 PST 2016


Take the results from the PolytopeIntersector, project them to screen
space, measure the distance from your mouse XY to the projected point, sort
the result set by this metric and take the closest.

On Fri, Dec 23, 2016 at 3:22 AM, Robert Osfield <robert.osfield at gmail.com>
wrote:

> HI Bruno,
>
> For a point cloud you may be best to implement your own
> osgUtil::Intersector, the design is meant to facilitate this,
> LineSegmentIntersector and PolytopeIntersector are both examples of
> subclasses from Intersector so you could use these as inspriation.
>
> Robert
>
> On 22 December 2016 at 17:02, Bruno Oliveira
> <bruno.manata.oliveira at gmail.com> wrote:
> > Hello,
> >
> > I have a point cloud and need to get the intersection of my mouse with
> that
> > point cloud. For that I use a PolytopeIntersector. I use this intersector
> > because I found out that a LineSegmentIntersector will not do the trick.
> >
> > I set the polytope width and height to 5.0 and therefore I get lots of
> > intersections, which is not good for me since I need to get the neartest
> > intersection to my mouse, and if I pick the first intersection of the
> > polytope I am not guaranteed to have that. A way of doing this would be
> to
> > change the polytope size to, for instance, 1.0 or 0.5, but this sometimes
> > results in no intersections.
> >
> > How can I get the cloud point that is neartest to the polytope's center?
> >
> > _______________________________________________
> > osg-users mailing list
> > osg-users at lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-
> openscenegraph.org
> >
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Chris 'Xenon' Hanson, omo sanza lettere. Xenon at AlphaPixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Code Forensics • Digital Imaging • GIS • GPS •
osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
iPhone/iPad/iOS • Android
@alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
623-PIXL [7495]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20161223/4c76ca63/attachment-0002.htm>


More information about the osg-users mailing list