How to define projection limits for glFrustum?

Hi all,

I have a question about glFrustum. Given a bounding box of geometry model, how to define “left, right, bottom, top, near, far” in glFrustum based the bounding box.

Thanks a lot!

Sophia

Yes, I meeted also this question. When I use orthographic projection, everything is ok, but the weird thing comes out when using glFrustum. Specially, I found the selection of near and far has a lot of influence on image rendering.

Sorry that I can not give you any help, and thank you to submit the question that I want to know also.

Originally posted by Sophia:

I have a question about glFrustum. Given a bounding box of geometry model, how to define “left, right, bottom, top, near, far” in glFrustum based the bounding box.

bboxWidth = right-left
bboxHeight = top-bottom
by varying your near plane you can pick what fov you like

A more intuitive function might be gluPerspective . A great demo for getting to know these functions are nate robbins’s projection tut .