PDA

View Full Version : Bounding box calculation ?



mikael_aronsson
11-17-2000, 02:35 AM
Hi !

Does any one here has some old code that calculates the bounding box around the view frustum ?

Mikael

Icehawk
11-17-2000, 07:00 AM
Originally posted by Mikael_Aronsson:
Hi !

Does any one here has some old code that calculates the bounding box around the view frustum ?

Mikael

That's a quite easy thing to do
All you need is to retrieve the 8 points that make the frustum.
For doing this you can use the glu function gluUnProject using the corners of the Viewport as x/y position and 0/1 for the z position.
You will get 8 points that build the frustum. Search for maximums and minimums for every component and you've your frustums bounding box.