# View frustum and bounding box problems.

5 views

### Antonio Santiago

Dec 24, 2006, 7:47:38 AM12/24/06
to
Hi group,

I have a little problem with my view frustum culling.

I am working using bounding boxes for my object (they are simple
cubes). As I read on some tutorials an object is out of the camera's
frustum if all their boundingbox points are out of the frustum.

The problem with this methos comes when the camera is near my objects
and some points are out for the right plane and some are out for the
left frustum plane. In this case, all the points are out of the frustum
camera but the object must be drawn.

Any ideas to solve this problem.

### Brandon J. Van Every

Dec 24, 2006, 8:15:18 PM12/24/06
to

Antonio Santiago wrote:
> Hi group,
>
> I have a little problem with my view frustum culling.
>
> I am working using bounding boxes for my object (they are simple
> cubes). As I read on some tutorials an object is out of the camera's
> frustum if all their boundingbox points are out of the frustum.

Which, as you've found, is not true.

What is true, is if all the bounding box points are *in* the frustrum,
then the object is in the frustrum. That's the "trivial accept"
condition. "Trivial reject" occurs if all the points are completely to
one side of one of the frustrum's *planes*. i.e. completely above,
completely below, completely left, completely right, completely in
front of, or completely behind the frustrum.

If it isn't trivial accept or trivial reject, then you've got a more
complicated clipping problem to deal with.

> The problem with this methos comes when the camera is near my objects
> and some points are out for the right plane and some are out for the
> left frustum plane. In this case, all the points are out of the frustum
> camera but the object must be drawn.
>
> Any ideas to solve this problem.

Well, clearly, you're gonna have to do more complicated geometry tests
for these cases. Quite a lot of ink has been spilled on this subject.
Don't the basic Computer Graphics textbooks cover this sort of thing
nowadays? Can't remember if mine did or not, it's been a long time
since I worried about frustrum clipping. Most people just use the 3D
HW nowadays to take care of this, so I take it this is a homework
problem, not a practical problem. Thus, what exactly to do is left as

No problemo. I'd offer up my ancient Free3d code for your edification,
but seeing as how I haven't compiled it in a decade, I think that would
be irresponsible. :-) Also I don't know if the solutions I employed
are good ones. Maybe you'd be better off poking at the source code of
the Mesa rendering library?

Cheers,
Brandon Van Every

### Antonio Santiago

Dec 25, 2006, 5:45:23 AM12/25/06
to

reverse, that is, if all points are out of the frustum then the
objectust be culled.

Thanks a lot.

On Dec 25, 2:15 am, "Brandon J. Van Every" <SeaFuncS...@gmail.com>
wrote:

> Antonio Santiago wrote:
> > Hi group,
>
> > I have a little problem with my view frustum culling.
>
> > I am working using bounding boxes for my object (they are simple
> > cubes). As I read on some tutorials an object is out of the camera's

> > frustum if all their boundingbox points are out of the frustum.Which, as you've found, is not true.

>
> What is true, is if all the bounding box points are *in* the frustrum,
> then the object is in the frustrum. That's the "trivial accept"
> condition. "Trivial reject" occurs if all the points are completely to
> one side of one of the frustrum's *planes*. i.e. completely above,
> completely below, completely left, completely right, completely in
> front of, or completely behind the frustrum.
>
> If it isn't trivial accept or trivial reject, then you've got a more
> complicated clipping problem to deal with.
>
> > The problem with this methos comes when the camera is near my objects
> > and some points are out for the right plane and some are out for the
> > left frustum plane. In this case, all the points are out of the frustum
> > camera but the object must be drawn.
>

> > Any ideas to solve this problem.Well, clearly, you're gonna have to do more complicated geometry tests

> for these cases. Quite a lot of ink has been spilled on this subject.
> Don't the basic Computer Graphics textbooks cover this sort of thing
> nowadays? Can't remember if mine did or not, it's been a long time
> since I worried about frustrum clipping. Most people just use the 3D
> HW nowadays to take care of this, so I take it this is a homework
> problem, not a practical problem. Thus, what exactly to do is left as
> an exercise to the reader.
>

> > Thanks in advice.No problemo. I'd offer up my ancient Free3d code for your edification,