PDA

View Full Version : Help with animating a lock-mechanism


TheMagician
10-30-2004, 11:00 AM
Hello everybody!

Here is a small animation problem that I face in 3d Max.

I want to animate this "lock-mechanism". It consists of two parts.



http://stefan.lohner-net.de/Max-Stuff/Schloss_Concept.JPG


- The blue part slides to the left

- and the green part does the corresponding "up and down" motion (it rotates around the red dot)




Now you all know that you can link parameters in Max ... for example link the rotation of a gear to another gear in your scene ... and if you rotate the first gear in the Max-Viewport ... the second gear rotates, too.

Do you think this is possible with my scene? Can I somehow link the sliding motion of the blue part to the "up and down rotation" of the green part ... so that if I move the blue part in my Max-Viewport the green part makes the correct motion.

Any ideas and suggestions are welcome!
Many thanks in advance.

Stefan

magicm
10-30-2004, 11:27 AM
If you're using max7 I would recommend using a Reaction controller (it's available in older max-versions as well, but it's much easier to work with in max7).

- Martijn

TheMagician
10-30-2004, 12:15 PM
Thank you for the tip Martijn.

I have not yet upgraded to Max 7. But I will, soon.

So I will have a look in the older versions of this controller.

Let's see if this helps.

Thanks again
Stefan

Haamu
10-30-2004, 01:56 PM
This can be done with reactor, wired parameters and IK setup. Reactor may be the easiest solution but offers least interactivity and may be kind of unpredictable if your settings are wrong. Wired parameters have real time update but can be difficult to setup as it propably needs some serious trial and error with the script values or pretty precise calcultation. IK setup can be tricky to constuct and is also sometimes rather unpredictable (realtime viewport acting differently than solved animation). I tested the locksetup like this:
All dummies have bezier position controllers (to enable sliding joint) except the one with path joint (path constraint). Rotation joints have been disabled from the parent dummies except the hinge axis for the pivot parent. Test with interactive IK on, animate and then apply ik (You'll notice that the interaction gets messed when you move the timeslider, and therefore have to be solved)

http://koti.mbnet.fi/sinko/host/locksetup.png

TheMagician
10-31-2004, 11:08 AM
Hi Capt_Suicide.

Thank you very much for your help!

However, I'm having a little trouble to understand exactly how this works. Do you still have this setup? If yes, would it be a problem to mail it to me?
I think it would really help me!

Thanks again.
Stefan

cutcopypaste
10-31-2004, 12:28 PM
The (LINK) image below shows this being done using Havocs Reactor. Dunno if this will apply to what you want done or not (?)

LINK (http://www.renderosity.com/uploads/Reactor Key Xmpl.mov)

TheMagician
10-31-2004, 12:46 PM
Wow cutcopypaste !

That is pretty much what I am looking for!

Was it hard to set up? How long did it take you?

cutcopypaste
10-31-2004, 12:59 PM
It shouldn't take you long.

Make your key and tumbler into meshes. (extrude the splines and convert)
Create a RBcollector and assign the key and tumbler to them.

Create two point helpers. Align them to the pivot of the tumbler and to the outside edge of the geometry on each side. (2 points help to keep the tumbler from tumbling)
Create two Reactor PointNails. Assign each point helper to each point nail.
Assign the tumbler to each pointnail rigidbody.

Create a Csolver.
Add the RB collector to it.
Add the PointNails as the constraints.

Give the tumbler mass in the reactor rollout. Assign it as a concave mesh.
Set the key as concave mesh. Set it as unyielding.
Set collison tollerance as desired. (probably.5 depending upon your world scale)
Animate the position of the key. (I started it at about frame 10.)
Run the simulation.

Good luck

(edit) The more frames you allow the key to be withdrawn, the more the tumbler will settle into the keys grooves. You might also want to add friction and remove elasticity from both the tumbler and the key.

TheMagician
10-31-2004, 02:37 PM
Thank you very much for the tutorial !!

I will give it a try tonight and post my results tomorrow!

Haamu
10-31-2004, 05:09 PM
Reactor is always the easiest solution as it doesn't require much thinking (is most logical).
cutcopypaste: You use max5 right? Some stuff you mentioned is obsolete in max 6 and 7 and is easier to accomplish (mentioning this so people with newer versions won't get confused).

CGTalk Moderation
01-19-2006, 05:00 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.