[osg-users] Intersection with a boundingBox

2010-07-07 Thread Baptiste Souli
Hello,

I have a scene  and i would like to clip considering a bounding box (i.e
cut the polygon at the border and eliminate the outside elements). 
Does there already exist in osg an implementation to calculate the 
interesection with a boudingbox (or a plane) or must I implement it? 
I have found PolytopeIntersector but I don't know if it calculate the 
intersection or just return the vertex in the boundingbox).

Thanks.
Aerkis.

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





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


Re: [osg-users] Intersection with a boundingBox

2010-07-07 Thread Robert Osfield
Hi Aerkis,

There is a osgUtil::PlaneIntersector that gives you the intersection
polygon between a plane and a scene, there is also the
PolytopIntersector but this tells you whether the scene contains any
geometry that has at least part of it in the polytop - it doesn't give
the intersection.

However, given your email I'm not sure either of these is what you are
after, and if you actually want to cut the polygons and create a whole
new geometry from the result then the OSG doesn't support this.
However, if you just want to do this for rendering then there is
OpenGL support for clip planes in the OSG so perhaps this is
sufficient.

Might I suggest explaining what you are after as a result rather than
focusing too much on the low level as doing so doesn't give us an idea
of what you are trying to do and why - advice for you will be much
more useful if you can provide a clearer to others.

Robert.

On Wed, Jul 7, 2010 at 9:14 AM, Baptiste Souli aer...@hotmail.fr wrote:
 Hello,

 I have a scene  and i would like to clip considering a bounding box (i.e
 cut the polygon at the border and eliminate the outside elements).
 Does there already exist in osg an implementation to calculate the 
 interesection with a boudingbox (or a plane) or must I implement it?
 I have found PolytopeIntersector but I don't know if it calculate the 
 intersection or just return the vertex in the boundingbox).

 Thanks.
 Aerkis.

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





 ___
 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] Intersection with a boundingBox

2010-07-07 Thread Riccardo Corsi
Hi Aerkis,

all the intersection routines you find under osgUtil are meant just to
find intersection (picking being the most common usage), not to clip
polygons.
For that purpose you should instead look at osg::ClipPlane/ClipNode
which implement GL clipping.

I don't think there's a routine which clips by a bb extents, you
should implement that by using 6 different clipping planes yourself.
See osgClip example for a reference.

HTH,
Ricky

On Wed, Jul 7, 2010 at 10:14, Baptiste Souli aer...@hotmail.fr wrote:
 Hello,

 I have a scene  and i would like to clip considering a bounding box (i.e
 cut the polygon at the border and eliminate the outside elements).
 Does there already exist in osg an implementation to calculate the 
 interesection with a boudingbox (or a plane) or must I implement it?
 I have found PolytopeIntersector but I don't know if it calculate the 
 intersection or just return the vertex in the boundingbox).

 Thanks.
 Aerkis.

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





 ___
 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