[osg-users] Intersection with 2d plane embedded in 3d

Chris Hanson xenon at alphapixel.com
Tue May 21 04:15:24 PDT 2019


I'll chime in and say that if the plane is not moving around in the world
coordinate system, doing the intersection outside of OSG's intersection
code is probably simpler.

On Tue, May 21, 2019 at 1:08 PM Robert Osfield <robert.osfield at gmail.com>
wrote:

> Hi Steve.
>
> On Tue, 21 May 2019 at 10:55, Steve Hardy <osgforum at tevs.eu> wrote:
> > Thanks for the reply.  I take it that quad intersection is the right
> approach for this problem.
>
> Well it's a simple approach.
>
> The "right" way would probably be to compute the ray to plane
> intersection separately, though I don't know how it would tie into the
> rest of your application code/usage.
>
> > So follow-up question: what would be a good way to improve efficiency?
> I know exactly which quad to intersect, but don't want intersection to test
> against all the other zillions of geodes in the scene.  It looks like the
> same node mask trick can be used with the intersection visitor, so
> hopefully I can use another node bit for that - although it looks like I
> have to turn off that bit in all except the node path from camera to quad.
>
> The OSG's IntersectionVisitor does tests against the bounding sphere's
> of the nodes in the scene graph to know whether it's worth traversing
> the subgraph or not, this avoids testing much of the scene graph.  If
> this isn't sufficient then you can assign KdTree's to the Geometry
> leaves to accelerate intersection testing.  See the osgkdtree example.
>
> Doing the ray to plane intersection separately from the OSG's
> IntersectionVisitor would be the most efficient solution, might even
> be less work given the above steps.
>
> Robert.
> _______________________________________________
> 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 • Forensics • Imaging • UAVs • 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/20190521/88e14dc8/attachment.html>


More information about the osg-users mailing list