   View Frustrum Culling
  I have the algorithm to check if a box is within the view frustrum, which works fine.  However, I also need to know if the view frustrum is within the box... does anyone have any elegant solutions for this?ThanksRael 
  Hi, You Can use The Bounging Sphere test which means you place an imagineary Sphere around the object  , give that the sphere is constructed from 4 vertcies , check if one of those veretx is(farther or nearer)than the clipping planes . sorry my english is really bad  . Ahmed Saleh , Egypt ;  Oh, I didnt understand what you want . ;  If the box is in the frustum then check if any of its vertices are in the frustum, if not then the frustum is entirely in the box.   ------------- outRider - ;  Is that strictly true?  Is none of the vertices are in the frustrum, the cube could be entirely to the left of the frustrum (for example), surely?Is there any way to get the 8 points that define the frustrum?   [edited by - Raeldor on August 3, 2003 1:35:32 PM];  EDIT: Doh I thought I was in the OpenGL section. My mistake. Well if you are using that then you could try gluUnProject on the 4 corners of your screen. I haven't used the function myself but it sounds like you can get values from the near and far clipping planes that way.   [edited by - LockePick on August 3, 2003 3:35:31 PM];quote:Is that strictly true? Is none of the vertices are in the frustrum, the cube could be entirely to the left of the frustrum (for example), surely?Is there any way to get the 8 points that define the frustrum?Let me clarify. I'm assuming that your code will determine if a box is in the frustum even though none of its vertices are. ______-\----/-| \  / |---\/---If your code does that (the above picture) then you're on the right track. For every box not completely in the frustum, but otherwise in view: check the vertices of the box, if any are nearer than the far plane, farther than the near plane, left of the right plane, right of the left plane, lower than the top plane, or higher than the bottom plane, then your box intersects the frustum and can't enclose it (the above picture). If none of the vertices meet the criteria then the frustum is completely in the box.   ------------- outRider -   [edited by - outRider on August 4, 2003 2:01:26 AM];  No, my code doesn''t determine if a box is in the frustum even though none of its vertices are.  That is the problem I have.  At the moment my code only returns true if any of the vertices of the box are inside the view frustrum ;http://www.markmorley.com/opengl/frustumculling.htmlThe above will tell you if a box is either completely within the frustum, 'intersecting', or completely out of the frustum. If the box is completely within the frustum then you're done, the frustum cannot also be in the box. Also, if the box is completely out you're done.If neither, the frustum is either completely in the box or the box is intersecting the frustum. To find out if the box is intersecting do what I said above, check all vertices for the 6 conditions above. If any of the vertices returns true for any of the 6 then the frustum cannot be completely within the box and the box is intersecting the frustum. If no intersection, the frustum is completely in the box.------------- outRider -   [edited by - outRider on August 4, 2003 11:30:28 AM];  Perfect!  And a very useful link, thank you!!!Rael