Hi Fredrik,

Fredrik Andersson wrote:
> Hi!
> 
> I am doing some intersection testing and realized that the intersect method
> in FrustumVolume is incorrect. 
> 
> bool FrustumVolume::intersect(const Pnt3r &point) const 
> 295 { 
> 296     bool retCode = true; 
> 297  
> 298     for(Int32 i = 0; i < 6; i++)  
> 299     { 
> 300         if((_planeVec[i].getNormal().x() * point.x() + 
> 301             _planeVec[i].getNormal().y() * point.y() + 
> 302             _planeVec[i].getNormal().z() * point.z() + 
> 303             _planeVec[i].getDistanceFromOrigin()     ) < 0.f)  
> 304         { 
> 305             retCode = false; 
> 306             break; 
> 307         } 
> 308     } 
> 309      
> 310     return retCode; 
> 311 }
> 
> 
> The last '+' should be a '-'.

Ack! Thanks, fixed and committed.

> Another thing that I found when I was looking around in the intersection
> code was that OSGTransform does not do a check on the bounding volume before
> visiting its children.

I did add that, please test it. I did some basic testing, but not very 
extensive.

> In DistanceLOD there is no intersection method registered so it uses the
> Group method. That means it visits all children regardless of what is drawn.
> Shouldn't it only visit the same as the RenderAction?

Yes and no. There is no real right answer for this one, it depends on what you 
want to use the intersection for. The alternatives are checking the highest 
resolution version, or the one that's closest to the ray (the current version). 
Give that yours is the right choice for picking (which I assume most people use 
the intersection for), I wouldn't mind changing it if someone sends me a patch.

Thanks!

        Dirk

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to