Mxs: Calculate delta_x , delta_y , delta_z of an object

104 views Asked by At

I want to calculate maximum/minimum x,y,z values of an object in my scene (in world coordinate system). I need these min/max x,y,z values in order to calculate my object's delta_x, delta_y, delta_z.

I'd like some advice regarding the best way to do this calculation.

I am currently using the built in obj.min and obj.max functions. However these functions return the minimum/maximum values of the bounding box, so when the bounding box is rotated relative to the world the min/max values these functions return will not be with respect to world coordsys.

I solved this by using resetXform on the object before using the built in min/max functions (resetxform aligns the bounding box with the world coordsys.

I think there must be a better way to calculate an object's min/max values (without using resetxform) but I have not found it yet. I have heard resetxform is a relatively slow function. I'd love to hear if there is any alternative way of doing the calculation.

Thank you! :)

1

There are 1 answers

1
Swordslayer On BEST ANSWER
nodeGetBoundingBox obj (matrix3 1)