Hi Brad,

Have you checked if any your Vertex-Coordinates contain
Infs or NaNs?

Does you geometry have any degenerated primitives
such as lines or triangles with identical vertices?

Next thing I would check would be the consistency
of geometry with respect to array lengths.

If everythings checks out ok, you could add the
NaN-check in PolytopePrimitiveIntersector::checkCandidatePoints
(in src/osgUtil/PolytopeIntersector.cpp).


Cheers,

Peter


Am 23.02.2011 08:54, schrieb Christiansen, Brad:
> Hi,
> 
>  
> 
> In my application I have found that the PolytopeIntersector is returning
> intersections with objects which are behind my camera. The code I am
> using is this:
> 
>  
> 
>       osgUtil::PolytopeIntersector* picker =
> 
>         new osgUtil::PolytopeIntersector(
> 
>         osgUtil::Intersector::WINDOW,                
> 
>         leftX,
> 
>         bottomY,
> 
>         rightX,
> 
>         topY);                     
> 
>  
> 
>  
> 
>       osgUtil::IntersectionVisitor iv(picker);  
> 
>       camera->getBound();
> 
>       camera->accept(iv);
> 
>  
> 
>       if (picker->containsIntersections()) {
> 
>  
> 
>         osgUtil::PolytopeIntersector::Intersections& intersections =
> picker->getIntersections();
> 
>         for (osgUtil::PolytopeIntersector::Intersections::iterator
> it=intersections.begin();
> 
>           it!=intersections.end(); ++it) {
> 
>  
> 
>             osgUtil::PolytopeIntersector::Intersection intersection=*it; 
> 
>             if(intersection.distance != intersection.distance) { //NaN
> 
>               //intersected object is behind the camera. Is this a bug?
> 
>             }
> 
>        }
> 
>      }
> 
> …
> 
>  
> 
>  
> 
> In my efforts to figure out what was going on I came across a possible
> clue. For all objects that are behind my camera,  intersection.distance
> != intersection.distance (i.e. intersection.distance is NaN). For now I
> have worked around the issue by simply discarding results where this is
> the case but I am guessing this is a bug.
> 
>  
> 
> Before I spend too much time stepping through the code to determine what
> is going wrong I want to make sure that this isn't the expected
> behaviour. Assuming this is a bug, can anyone who has worked with these
> classes before offer any suggestions that might help me track down the
> issue?
> 
>  
> 
> Cheers,
> 
> Brad
> 
>  
> 
> DISCLAIMER:---------------------------------------------------------------------------
> This e-mail transmission and any documents, files and previous e-mail
> messages attached to it are private and confidential. They may contain
> proprietary or copyright material or information that is subject to
> legal professional privilege. They are for the use of the intended
> recipient only. Any unauthorised viewing, use, disclosure, copying,
> alteration, storage or distribution of, or reliance on, this message is
> strictly prohibited. No part may be reproduced, adapted or transmitted
> without the written permission of the owner. If you have received this
> transmission in error, or are not an authorised recipient, please
> immediately notify the sender by return email, delete this message and
> all copies from your e-mail system, and destroy any printed copies.
> Receipt by anyone other than the intended recipient should not be deemed
> a waiver of any privilege or protection. Thales Australia does not
> warrant or represent that this e-mail or any documents, files and
> previous e-mail messages attached are error or virus free.
> --------------------------------------------------------------------------------------
> 
> 
> 
> 
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

-- 
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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to