Notifications
Clear all

[Closed] constrain multiple objects ontop of another

Hey guys,

i’m wondering if there is a script out there that would basically constrain one object to another.

An example would be, say i have a hillside mesh, and a bunch of boxes scattered across the hill. While i move the boxes around the hill, i’d like to keep the boxes pivot point to be constrained under the hill, so they won’t be floating. I would also need to do this with new objects that were added on the hill.

The kicker is, i’d prefer to do this without any constraints or modifiers. So i’m assuming collision code is the way to go…

Is there a way to do this that is already out there, or can someone point me in the right direction.

thanks.

6 Replies

check out this thread and the script Bobo wrote:
http://forums.cgsociety.org/showpost.php?p=6270811&postcount=9

It is generating tea pots on the surface of this object, but you could modify it to constrain your objects to your ground plane.

the most natural way to do these things is to use the Attachment position controller and to make your own edit position/rotation tool to change attached nodes transforms. but you don’t want to use constraints… why?

i can give you many reasons why the attachment controller solution better then other possible solutions like – script controllers, when constructs, or event callbacks…

Thanks for the reply thedour

Unfortunately, this isn’t really what i’m looking for.

already have tools to initally place objects on the mesh… its in my tweaking phase of re arranging positions, is when i’d like to be able to say, click abutton, and while i move the object, 3dsmax keeps its pivot.z constrained to terrain. Allowing me to reposition and rotate at will, but will prevent the object from being lifted off terrain, and thus be floating.


Hey Denis,

I guess my concern with constraints is my limited knowledge with them, so if there is an quick solution with them, i’d give it a try. I’d just prefer not to add elements to our scenes that our engine might choke on later.

I want to tell you the story…

A spell ago I made absolutely perfect scatter/paint terrain tool. User could scatter any objects or group of objects using vertex position, face center, edge center, and everything else. User had tons types of randomization. User could paint objects with paint tool, smooth density, move, smudge, etc., and use vertex color channel or bitmap texture for object distribution. All objects were constrained to terrain and followed any terrain’s deformation. When the tool was ready I gave it to my artists and designers. They said: “Wow! That’s the greatest and the coolest tool that we’ve ever seen!”. But … at same time hey dropped their eyes or looked aside. They were not happy.
And I made another tool – the one button “Drop” tool. When they pressed the button all selected nodes dropped DOWN onto terrain, when they pressed the button with CTRL the nodes “dropped” UP, when they pressed the button with SHIFT the nodes dropped on world ZERO level.

Currently the scatter tool stored somewhere in my archive as a source of math, tech, and everything else solutions. Sometimes I touch it, air out, and dust.
The “Drop” button is polished by millions of touches.

The End.

The moral of this story is that…
If you want to learn, head for the tool N1. If you have to give an immediate result, the tool N2 is the better way.

 JHN

Hahahaha, great story, and so true, I’ve been in similar situations, where my grandiose plans where shot down even before I start scripting them, and end up with a code snippet without a UI that does the same but only takes an hour to write instead of 3 days… There’s “what you like to do” and then there’s this nasty thing called “production”

-Johan

haha, Good Story.