View frustum and bounding box problems.

5 views
Skip to first unread message

Antonio Santiago

unread,
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.
Thanks in advice.

Brandon J. Van Every

unread,
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
an exercise to the reader.

> Thanks in advice.

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

unread,
Dec 25, 2006, 5:45:23 AM12/25/06
to
Thanks Brandon for your reply in this date (happy christmas!!!).

Your reply was very helpfull for me. My problem was thinking in the
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,

Brandon J. Van Every

unread,
Dec 26, 2006, 3:48:03 PM12/26/06
to

Antonio Santiago wrote:
> Thanks Brandon for your reply in this date (happy christmas!!!).

No problemo! Merry Xmas as well.
Brandon

Reply all
Reply to author
Forward
0 new messages