Hi again Andrew,

Andrew Cunningham schrieb:
Hi,

I am having some problems with the "distance" found by the PolytopeIntersector  
but only when the  geometry I am trying to pick has a non-null (Matrix)Transform in it's 
parent.

The PolytopeIntersector registers that object as a 'hit', BUT the distance 
recorded appears to be incorrect ( the end result is  I end up 'highlighting' 
the wrong object  behind the object I want to pick).
The intersection calculation works perfectly (with the transformed object) but the distance to the reference plane (used for sorting the intersections) does not accurately reflect the expected distance. Just to re-iterate this. As long as I do not try to pick a node with a transform, the sorting of the PolytopeIntersector works as expected....

Using the "LineSegmentIntersector" on the same scene does not show the issue. 
It correctly sorts the intersections.

Any ideas?

I had another look at the code and found a nasty surprise in
Plane::transformProvidingInverse(). There is a call to
Plane::makeUnitLength() in it which should totally screw
distance results of PolytopeIntersector if you have any non-orthogonal Matrix-Transforms (i.e. scaling).

Could you try commenting out this line and check if it works for you?
If it does help I will think of a proper fix.

Thanks
Andrew

Cheers

Peter
--
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Michel Lepert
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to