The Industry's Foundation for High Performance Graphics

1. IsInFrustum implementation

Hi All,

Anybody can help me to understand what the 'findOpposingPointsMostPerpendicularToPlane' function does in this code snippet? Does it check the distance of each corner (8 times) of the AABB from the frustum plane and returns the min and max one?

http://stackoverflow.com/questions/9...-is-really-big

Thanks,

Alberto

2. Re: IsInFrustum implementation

Originally Posted by devdept
Anybody can help me to understand what the 'findOpposingPointsMostPerpendicularToPlane' function does in this code snippet?
I think what it's doing is returning 2 AABB corners: one which is the furthest along the positive direction of the plane normal, and one which is the furthest along the negative direction of the plane normal.

3. Re: IsInFrustum implementation

Thanks Dark Photon,

In this case they are computing 8 signed distance and sorting them, it's quite expensive...

4. Re: IsInFrustum implementation

Originally Posted by devdept
In this case they are computing 8 signed distance and sorting them, it's quite expensive...
They could, but that'd be very inefficient.

For instance, to find furthest positive point:
Code :
```  pt.x = (normal.x > 0) ? max.x : min.x;
pt.y = (normal.y > 0) ? max.y : min.y;
pt.z = (normal.z > 0) ? max.z : min.z;```
Make min/max a 2-element array and you can nuke the conditionals.

5. Re: IsInFrustum implementation

Wow, I will try immediately...

Thanks,

Alberto

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•