PDA

View Full Version : snap to lowest vertex


Sorath
01-26-2011, 12:15 PM
we already head a similiar post here..

but I have 5000+ cubes (instances) floating above the ground..
I need to move them down to the ground plane. can't use particles with collision anymore.

the easiest solution in my mind is snap the locator of the selected cube to the very bottom.
then move the cube until it snaps to the ground.

but I have no idea how to script that since snapping doesn't exist in the documentation!?

input very welcome
thx
Bastian

Robert Bateman
01-26-2011, 05:04 PM
query world space bounding box (via xform). Get the minimum world space bounds value for Y axis (or which ever you are using for up). Use the move command (or xform) to move (0, -Y_world_space_bounds_min, 0). Done.

CGTalk Moderation
01-26-2011, 05:04 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.