Sign in to follow this  
ksierens

Bounding box from a gluQuadric?

Recommended Posts

Why would you want to do that? It's easy to make one yourself with 12 triangles or 6 quads. You get the min/max values of your object and walla you have your bounding volume.

Share this post


Link to post
Share on other sites
I am using primitives such as gluSphere, gluCylinder, etc, with a matrix applied to them, and need to get their bounding box information.

Share this post


Link to post
Share on other sites
There is no gluGetBounds function, but since *you* have to provide some parameters to those functions to descibe the size of the object (the radius parameter in gluSphere for example), it stands to reason that you already know the size of the object before you create it. Therefore, you can easily compute the bounds of the object. For example, a sphere with radius x will be contained in a box of with a width of 2*x, a height of 2*x, and a depth of 2*x. A cylinder with radius x and height y can be contained in a box of size 2x * 2x * y. Just imagine the shape of the object and you should be able to create a bounding box for it. Sketching it out on paper may make it more apparent.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this