Jump to content
  • Advertisement
Sign in to follow this  
ksierens

Bounding box from a gluQuadric?

This topic is 4093 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!