Notifications
Clear all

[Closed] nodeLocalBoundingBox

 PEN

Any one use this before. Looks to me like it is still returning a world bounding box and the values are backwards, ie;[max,min]

Can any one confirm this or has used it and found the same issues. This test was in 2011.

27 Replies
 PEN

I should mention that nodeGetBoundingBox and passing the needed matrix works.

hey!
its been long time since i played with nodegetboundingbox but afaik nodelocalboundingbox returns the transformed (oriented) bounding box the one you can see in the viewport (‘j’ to toggle it) where as nodegetbounding box returns a box that encloses the rotated object.

 PEN

I know what it is supposed to do but it is not doing that here, did you test it?

nodeGetBoundingBox obj obj.transform returns the correct bounding box for the local that it seen in the viewport.

 lo1

I can confirm it is not working for me in max 2009.

hmm… it always worked and still works for me. i used it in many places…
here is the correspondence between nodeLocalBoundingBox and nodeGetBoundingBox:
pseudo


 (nodeLocalBoundingBox <node>) == (nodeGetBoundingBox <node> <node>.transform)*<node>.transform
  (nodeLocalBoundingBox <node>)*(inverse <node>.transform) == (nodeGetBoundingBox <node> <node>.transform)
  

nodeLocalBoundingBox is very usefull:


 (
 	b = box()
 	rotate b (angleaxis 32 [0,1,0])
 	rotate b (angleaxis 48 [1,0,0])
 	move b [10,0,0]
 	bb = nodeLocalBoundingBox b
 	p1 = point pos:bb[1]
 	p2 = point pos:bb[2]
 )
 
 PEN

That is basiclly the test code from the help and it wasn’t working. I will test again after I have this rig out the door and see what was going on.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

oops… i swear i didn’t look in the help when i was writing the post

what is not working? is it not working with the coordsys context?

 PEN

It isn’t returning a local bounding box the way that it is shown in the help. Rotate the object and it produces different values when it should always give the same ones relative to the objects pivot.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

the function works correct but has a confusing name. the function returns local bounding box corners transformed in world space coordinate system. to get really local values you have to multiply it on inverse object’s transform. it always worked this way.
i can’t name the function correct… something like – worldspaceLocalBoundingBox

resuming:
nodeLocalBoundingBox == relative to identity matrix
nodeGetBoundingBox == relative to specified matrix

in coordsys local nodeLocalBoundingBox $ == nodeGetBoundingBox $ $.transform

 PEN

I think that is why it does not appear to work correctly, I’m not quite sure when I would need what it does by default. Thanks for the help. I have it working the way that I first outlined so I will stick with that. I’ll play more with it when I have time to see what I can get out of the local bounding method.

Page 1 / 3