Frustum Culling problem (With Octree)

Hi guys.
I got a question here.
I’m using octree to do my frustum culling and someday I’ll do my collision detection too with it.
for now my octree is almost working.
the only problem is that when I check if the bounding box of an octree is in my frustum, it may return a false result if the bounding box is so large that it’s my frustum that is entirely inside the bounding box.
for exemple, in the first subdivision, my bounding boxes width may be like 1000 units, and if I’m standing in the middle of it and if my far viewing distance is like 200, well none of the bounding boxes corners will be in my frustum because the bounding box is too big (so the box is not in the frustum it’s the frustum that is in the box you know what I mean ?)

I hope you understand the problem…
My guess is to get, by some way I don’t know (that’s my question in fact), the 3d position of the 8 frustum corner. (using the position of my camera and the far and near clipping distance and an angle I guess…)
this way, I could do this test (pseudo-code)
if(Box is indide(entirely or partially) the frustum OR frustum is inside the box (entierly or partially)
then render(or go in a deeper octree level.

So i need to know the geometric position of my frustum…All I managed to get with my current knowledge is the distance from the origin for each plane and their normals…

Any one can help ?
thanks a lot !


Evil-Dog
Let’s have a funny day

All I managed to get with my current knowledge is the distance from the origin for each plane and their normals

isn’t this the position of your frustum? distance from the origin?

b

Nope

If you go 100 unit along the x axis or the z axis
the distance is 100 unit in both case but the real position isn’t given
with the normal and the distance I can know where the clipping planes are I think…but what is the width and height of the near and far clipping plane ? with the width, height of the near and far plane and the normal and distance from origin I could have the 8 corners of my frustum.

width/height(?)

o------------o
\ /
\ /
\ /
o----o
width/height(?)

Beautiful ascii hehe

Anyone can help ?


Evil-Dog
Let’s have a funny day

woops…my ascii drawing doesn’t show right…anyway

you get the problem I need the width, height, normal and distance for the far and near clipping plane I think !
If someone knows how I’d be glad.


Evil-Dog
Let’s have a funny day

http://www.markmorley.com/ has a tutorial on frustum culling, it might help. I use it in my frustum-octree culling anyway.

Thanks alot AndersO
the link was very very useful
With the sphere test is resolve the problem when the bounding box totally encloses the frustum !

thanks again !


Evil-Dog
Let’s have a funny day