Bounding box from a gluQuadric?

Started by
2 comments, last by CodeMunkie 16 years, 11 months ago
Is there a way to get the bounding box from a gluQuadric?
Advertisement
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.
I am using primitives such as gluSphere, gluCylinder, etc, with a matrix applied to them, and need to get their bounding box information.
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.
"When you die, if you get a choice between going to regular heaven or pie heaven, choose pie heaven. It might be a trick, but if it's not, mmmmmmm, boy."
How to Ask Questions the Smart Way.

This topic is closed to new replies.

Advertisement