[osg-users] Using InfinitePlane

Robert Osfield robert.osfield at gmail.com
Fri Jun 24 01:12:02 PDT 2016


HI Valerian,

On 24 June 2016 at 09:01, Valerian Merkling <niarkoleptik at gmail.com> wrote:
> InfinitePlane is an osg class, defined in osg/Shape.

Oh, that old class.  Once written, forever forgotten...

Written back in 2002 It's original intention was to support collision
detection/pyhsics engines as were the rest of the osg::Shape classes.
In the end though they've never ended up being used for this.  Only a
few of the osg::Shape classes have been actively usd, primarily just
for quick and easy visualization of spheres and boxes. even that
hasn't been a recommended path though as they don't offer good
performance.

> According to osg documentation, InfinitePlane cannot be rendered but is used to support collision detection, so I guess I can use it to compute intersection between mouse clic and an imaginary ground.

It's probably time I removed that docs, suggestion this.  There isn't
an support in the osgUtil intersectors for this.


> I'm working on a GIS app, rendering large raster image with elevation, and I need to :
> - get the x,y,z coordinate of the point under the mouse when I clic on a 3D rendered tile (and it already work)
> - get the x,y,z=0 coordinate of the point under the mouse when I clic everywhere else, like far away from the rendered scene. And that's where I'm stuck.

I'd just compute the position given the ray in world coordinates and a
ground plane.  The maths is pretty simple.

Robert.



More information about the osg-users mailing list