Re: [osg-users] Simple way to determine if a point is inside a geometry

2009-07-30 Thread Andrew Thompson
Hi Gordon,

Thanks for your reply, I'm going to give that a go. 

First check - see if its in the bounding sphere of the PAT
Second check - go for the bounding boxes of the drawables. 

I guess I'll need to inverse transform my point by the PAT's matrix first?

Anyway good to know it's not too difficult, 

Thank you, 
Andrew

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15633#15633





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Simple way to determine if a point is inside a geometry

2009-07-30 Thread Gordon Tomlinson
FYI Bounding::sphere and bounding box  both have ::contains( const vec3  vec
), both return true if the given point is within their volume


__
Gordon Tomlinson 

gor...@gordontomlinson.com
IM: gordon3db...@3dscenegraph.com
www.vis-sim.com www.gordontomlinson.com 

__

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Andrew
Thompson
Sent: Thursday, July 30, 2009 5:10 AM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] Simple way to determine if a point is inside a
geometry

Hi Gordon,

Thanks for your reply, I'm going to give that a go. 

First check - see if its in the bounding sphere of the PAT
Second check - go for the bounding boxes of the drawables. 

I guess I'll need to inverse transform my point by the PAT's matrix first?

Anyway good to know it's not too difficult, 

Thank you, 
Andrew

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15633#15633





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Simple way to determine if a point is inside a geometry

2009-07-30 Thread Andrew Thompson
Yep, will do, its a great start though, thanks

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15658#15658





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Simple way to determine if a point is inside a geometry

2009-07-29 Thread Andrew Thompson
Hi there, 

Given a single object in my scene graph defined by the hierachy

PositionAttitudeTransform (x1)
   |
Geode (x1)
   |
Geometry (x1)
   |
Drawables (x Many)

Is there a simple way to determine if a point location is inside the geometry, 
taking into account transforms applied by the PAT?

I am reluctant to use the intersect visitor, as the scene is very cluttered and 
I will likely get lots of intersections, and this may be time-consuming to 
determine whether the intersection was with my geometry object. 

Any ideas?

Thank you!

Andrew

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15610#15610





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Simple way to determine if a point is inside a geometry

2009-07-29 Thread Tomlinson, Gordon
One way might be something along the lines of


1) use the boudingspehere of  PAT to see if you point is with in the
bounding sphere  if its not then stop/bail ( you will have to transform
the sphere by the pat transforms etc)

2) Iterate over each drawables boundling box ( transfromed by applying
the Pat matrix ) and test the  to see, if the point is inside the
bounding box, do what you need to do

3) get to this point , your not inside so bail

You could also trnasform the point into the PATs reference frame as well

There are helper functions/methods for these tests etc.


Gordon
Product Manager 3d
__
Gordon Tomlinson
Email  : gtomlinson @ overwatch.textron.com
__


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Andrew
Thompson
Sent: Wednesday, July 29, 2009 11:54 AM
To: osg-users@lists.openscenegraph.org
Subject: [osg-users] Simple way to determine if a point is inside a
geometry

Hi there, 

Given a single object in my scene graph defined by the hierachy

PositionAttitudeTransform (x1)
   |
Geode (x1)
   |
Geometry (x1)
   |
Drawables (x Many)

Is there a simple way to determine if a point location is inside the
geometry, taking into account transforms applied by the PAT?

I am reluctant to use the intersect visitor, as the scene is very
cluttered and I will likely get lots of intersections, and this may be
time-consuming to determine whether the intersection was with my
geometry object. 

Any ideas?

Thank you!

Andrew

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=15610#15610





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org