Re: [Algorithms] octree and HSR
Brought to you by:
vexxed72
From: A. J. C. <Alb...@te...> - 2000-08-31 15:40:02
|
----- Original Message ----- From: "Dave Eberly" <eb...@ma...> To: <gda...@li...> Sent: Thursday, August 31, 2000 7:47 PM Subject: Re: [Algorithms] octree and HSR > From: "A. Jeffrey Cahyono" <Alb...@te...> > > > > 4. How can I check if the view frustrum and a cube intersect? (or if the > cube is inside > > the view frustrum) > > This is easy once you've created the view frustum. > > Just test the eight corners of the cube against the six frustum plane like > this. > <snip of code> > > I do not believe your code handles the case when the eight > corners of the box are outside the frustum, but the box > still intersects the frustum (or completely contains the frustum). > If you can guarantee that your bounding boxes are small > enough relative to the frustum (for example a rectangular > face can never be large enough to contain the near face > of the frustum), then not a problem. I've tested that kind of case and the testing function returns IC_STRADDLE. This algorithm is a conservative testing. BTW I've checked out tour intersection library and it really cool! I also would like to apologize because I forget to mention that the original idea of this algorithm was came from Thatcher Ulrich's terrain demo. |