Hi Eric,

Anyway, I copied the LineSegmentIntersector stuff  from
osgkeyboardmouse into my SimpleViewerCocoa, but I seem to be having
the same problem with Projection nodes as I did before.

Could you reproduce the problem with a small standard OSG example?  I
can't test out Cocoa based apps.

I'll give it a shot (but I was operating under the assumption that
this worked in the standard osg examples and it was something wrong
with my code).



Its the type of Intersector that they are, so a LineSegmentIntersector
uses a line segment to intersect the scene (as the old
IntersectVisitor/PickVisitor did), PolytopeIntersector uses a polytope
to interesect the scene, and PlaneIntersection uses a plane to create
a slice through the scene.

Thanks, that helps clear that up. So if I wanted to do a
selection-rectangle (rubber-band) like you find in many 2D image
applications, would PlaneIntersection be the best way to do this or
would would I need to use a Polytope Intersector (since my
selection-rectangle isn't infinite in width and height)?


If you start the IntesectionVisitor traversal from the osg::Camara the
IntersectionVisitor will use the camera's viewport, projection and
view matrix so reproject the initiali intersection from its coordinate
frame (WINDOW) into the model coordinates where it'll do the
intersections.



If your use PROJECTION as the coordinate frame then you'll need to
pass in coords in -1,1 clip space range, and then IntersectionVisitor
will just transform them by the Projection and View matrices of the
Camera.

What coordinate frame is your mouse coordinates in?  If they are in
window coordiantes then just use WINDOW as you are doing.

So my mouse coordinates are aligned with the View coordinates which I
think fits with this definition of WINDOW.

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

Reply via email to