Notifications
Clear all

[Closed] Help with an objects bounding box in local space

Hi guys,

I’m getting some strange results when trying to derive an objects length, width and height from it’s bounding box. I was going to use $.min and $.max to simply calculate its dimensions, but you will see from the following Ive ran into some hurdles.

If I have a box length30, witdth50, height80 with its pivot at the origin and I perform $.min I get the following


$.min
[-25,-15,0]
$.max
[25,15,80]

If I lift the box up by Z:20 I get the following


$.min
[-25,-15,20]
$.max
 [25,15,100]

With the box still lifted by Z:20 i get the following


in coordsys local $.min
[-25,-15,0]
in coordsys local $.max
 [25,15,80]

Now here’s the strange part. If I ROTATE the box by absolute world x10 y10 z10 and do the following


 in coordsys local $.min
 [-29.5372,-26.9091,-7.66483]
 in coordsys local $.max
  [29.5372,26.9091,87.6648]
 

Why isn’t that returning [-25,-15,0] for $.min and ,[25,15,80] for $.max

So I guess what Im asking, is does .min and .max return an axis aligned bounding box. And, is there anyway to get the extents/boundingbox of an object in its own local aligned space?
i.e an object aligned bounding box rather than an axis aligned bounding box.

Regards,

2 Replies

Sorry, I don’t have time to answer all your whys. But take a look at nodeGetBoundingBox and nodeLocalBoundingBox functions in mxs help.

Once again indebted to your help.
Thanks Denis…