Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Bounding Box Volume, how?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 ogracian   Members   

180
Like
Likes
Like

Posted 31 August 2001 - 12:59 PM

Hello I am writting a MAX plugin, but in my plugin I need to compute a bounding box to enclose all my scene objects, I mean, soupouse I have a scene composed by several boxes, so my question is how can I compute a box to enclose all my scene boxes? Thanks in advance!! Oscar

#2 nosfy   Members   

194
Like
Likes
Like

Posted 31 August 2001 - 01:39 PM

This is easy. You just iterate through all objects and check for the absolute min X, Y, Z and max X, Y, Z.

And voila, you got your bounding box surrounding all your objects.

Patrick Lafleur

System Engineer
Creation Objet Inc.

#3 ogracian   Members   

180
Like
Likes
Like

Posted 31 August 2001 - 02:30 PM

thanks for your help, but I still have some questions which I really appreciate if you could help me.

So to get the bounding box for all my scene objects just iterate through all objects and check for the absolute min X, Y, Z and max X, Y, Z. But then how can I set my bounding box width, length and hegight?

I mean, how can I compute the length, width, and height from the absolute min, and max?

for last, how can I compute the position of my box, so It enclose all my scene objects?

Thanks for your help!.
Oscar



#4 Icarus3   Members   

122
Like
Likes
Like

Posted 31 August 2001 - 08:47 PM

If you have the maximum and minimum values you already have the length and width and height of the box:

Length = absmax_x - absmin_x
Width = absmax_z - absmin_z
height = absmax_y - absmin_y

To calculate the center of it you do it like this

centerx = length/2
centerz = width/2
centery = height/2

Just use those coordinates you just have calculated and now you have the center of you bounding box

voila. As easy as it is




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.