Hi Chris,

I've read your email twice but still don't understand what you are getting at.

I don't know if its relevant, but the PolytopeIntersector only checks
if any one of the points on a osg::Geometry are contained in the
polytope for it to return true.  This is just a preliminary version
and which will only work properly for point data sets.

For lines and polygonal models if all the points are outside the
polytope then it won't return an intersection.  For this to work we'll
have to complete the implemention, testing indivually against each
line segment and triangle against the polytope.

Robert.

On 11/17/06, c sklu <[EMAIL PROTECTED]> wrote:
Hi Robert,

Box-selection seems to be working roughly, but I am getting the
following behaviour. When doing the box select, the
PolytopeIntersector is returning hits for an object in what seems to
be a screen-aligned box around the object. I've attached two
screenshots which will hopefully make it clearer.

In box-horz.jpg, because the general orientation of the strip is
horizontal, the screen-aligned box fits the object closely. The yellow
rectangle indicates the region where PolytopeIntersector returns hits.

In box-angle.jpg, you see the screen-aligned box doesn't fit the
object very well. Again, the yellow rectangle represents the region
where hits are returned...

I've looked through the code and I don't understand how this can be.
Ultimately it boils down to the call: Polytope::contains( const
std::vector<Vec3> & ) which then recurses down to each of the planes
and sees which side the vertices are on (I imagine). Any ideas on how
this can happen?

Cheers,
Chris


On 11/14/06, Robert Osfield <[EMAIL PROTECTED]> wrote:
> Hi Chris,
>
> On 11/14/06, c sklu <[EMAIL PROTECTED]> wrote:
> > Thanks for the reply, that's what I thought and I got things to work.
> > My problem was however that I wasn't passing the root of the
> > scenegraph to the IntersectVisitor. I was kind of wondering about this
> > because in the PickVisitor, the viewport, projection, and model
> > matrices are passed into the constructor. So I assume the new
> > IntersectionVisitor is getting the initial transformations from the
> > CameraNode which is usually at the root of the scenegraph. Is this
> > correct?
> >
>
> Yes the osgkeyboardmouse example uses the topmost CameraNode to set up the
> IntersectionVisitor with the appropriate viewport, projection and view
> matrices, then clones the source
> PolytopeIntersection/LineSegmentIntersector and during the
> cloning process the intersector is transformed into the new coordinate frame
> defined by the current viewport/project and view matrices.
>
> The cloning action happens any time a new CameraNode or Transform node is
> encountered.  Its really an implementation detail that end users needn't
> worry about.  If you want to implement your own Intersector then you'll need
> to implement the clone method and therefore know about the transformation
> step.   The exisitng Intersector implementation should provide a guide for
> the later.
>
> Robert.
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
>


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/



_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to