Getting the height, width and length of models (SOLVED)

Well… For my collision system, I’ve been using position/distance checking, to see whether the objects are intersecting each other, and its working well so far…

However, I really want to know, is there an easy way to get hold of the approximate height/width/length of a model? The egg files, especially the ones in the tutorials…

If not, is there some way I can get hold of the height/width/length of a model when creating it in maya or so?


Yes, you can call getTightBounds(), which returns a tuple containing two points: min and max. Doing max-min gives you the dimensions:

min, max = model.getTightBounds()
size = max-min

Ah… Yep, it works!

Thanks alot for the help!

just a question though, what dimmensions do you get when you do max-min?

I think the object’s length, width and height relative to it’s parent.