Results 1 to 5 of 5

Thread: IsInFrustum implementation

  1. #1
    Senior Member Frequent Contributor
    Join Date
    Dec 2005
    Location
    Italy
    Posts
    659

    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. #2
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,661

    Re: IsInFrustum implementation

    Quote 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. #3
    Senior Member Frequent Contributor
    Join Date
    Dec 2005
    Location
    Italy
    Posts
    659

    Re: IsInFrustum implementation

    Thanks Dark Photon,

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

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,661

    Re: IsInFrustum implementation

    Quote 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. #5
    Senior Member Frequent Contributor
    Join Date
    Dec 2005
    Location
    Italy
    Posts
    659

    Re: IsInFrustum implementation

    Wow, I will try immediately...

    Thanks,

    Alberto

Similar Threads

  1. Implementation of EGL API
    By hesham in forum OpenGL ES
    Replies: 0
    Last Post: 10-02-2012, 11:31 AM
  2. GLU| ES implementation
    By Roberto in forum OpenGL ES
    Replies: 6
    Last Post: 05-10-2008, 05:11 AM
  3. OT: SSE implementation in C++
    By GPSnoopy in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 04-27-2002, 01:46 PM
  4. Si implementation
    By OldMan in forum OpenGL: Linux
    Replies: 2
    Last Post: 12-20-2001, 08:30 AM
  5. SGI implementation
    By dmy in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 04-29-2000, 09:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean