Notifications
Clear all

[Closed] [Help] selection bottom center

does anyone know how to get selection bottom center, but not like ordinary methode (selection.min )…or so…I want to get selection bottom center from rotated object and put the point at it, btw some of the object from detached obj , reseted xform , etc…I want to be like this

The thing I already did [maybe some missing step or so]

  1. store orignal object rotation on selection and return back in [by grouping or not], I want to get the bounding box of selection when it normal [quat 0 0 0 0]…but some object not in the correct position after rotated or located far from object collection which mean the bounding box selection become larger, …i tried to attach all object but abandon it , cause attaching it take much longer time when I have large object in selection…so I give up on this methods :banghead:

  2. tried to locate selection bottom center by making prxoxy bounding box [like miuu pivot placer] , its fine when using one object cause I know which object I want to make the reference of it transformation , but when it array of object [selection] I dont know which on I want to make reference !! :banghead: :banghead:

could it calculated by vector, I dont know anymore which it is, cause selection only have 4 properties you can read [min, max,center,count]…I tried to rotate object selection using selection.rotation= quat 0 0 0 0 but the same result happen, bot all object rotation the same direction, like when Im using gizmo control.

So could some one give me the right direction ?

Thanks

Best regard

Fajar

3 Replies

you probably can’t believe how easy it is.
my problem is that i don’t have max to try … but i can try to write it blind:

bb = nodegetboundingbox node node.objecttransform
center = (bb[1] + bb[2])/2
center.z = 0
thepoint = center * node.objecttransform

(sorry for all lowercase… sent from my phone)

selection itself doesn’t have (and cannot have) local coordinate system. there is an algorithm that finds an optimal bounding box for a cloud of points. i don’t want to post it here, but the idea is:

calculate world bbox

start rotate it about some axis to find a minimal bbox by volume

repeat it for another axis

and for another axis…

to make the algorithm works faster:

first rotation steps big (smartly big)

next are smaller

next are smaller than previous

About all lower case dont mind it. Thanks denisT…i’ll try your sript altho I already tried it before, But may be I do the wrong thing, i must read your second post really carefully, can you elaborate by what do you mean by:

first rotation steps big (smartly big) = if first is selection then whats the smaller than it ? object in selection ? but what smaller than object ? ::confuse, itsl like I m reading a riddle here.

next are smaller

next are smaller than previous

[Ahhh … you can just give an illustration by picture or writing]

Thanks