2
$\begingroup$

enter image description here

Above image is the correct way to hinge practically, when i fold the leg of the table. with the constraint i have bend the legs.

What im looking is when i pull this empty both the side should fold down with the side legs. How to connect and make it fold or link.

video

enter image description here

Blender file

$\endgroup$

2 Answers 2

2
$\begingroup$

What you are looking for is to transform a location value into a rotation value, and this is exactly what math functions arc sin and arc cos do.

In my example I used an Armature with bones, but you can use Empties as well.

Set the desired rotation to happen on X axis, right click on the X rotation value and choose "Add Driver".

In the Driver editor page set the variable to measure a distance, and set the distance objects (Base and Controller).

Now set the driver Type to Scripted Expression and type the expression " -asin(var/2)", where the number 2 is the desired lenght of the half of the table.

As it's important to stay between allowed values, I set a Limit location constraint on Controller bone, going from 0 to 2, and a copy rotation constraint from Side.L to Side.R.

enter image description here

$\endgroup$
0
2
$\begingroup$

you could use a rigid body animation - if that's ok for you.

First you have to make one rigid body object for left and right side. Then you add a cylinder as hinge (+rigid body). Then you can add two hinge constraints from left to cylinder and from right to cylinder. Be careful, that the rotation of the hinge constraints are correct -> z-axis in direction of the cylinder. Of course you also need a ground as passive rigid body. Then you can animate the cylinder and get something like this:

enter image description here

if you want 100% control over the animation, Josh's answer might be more suitable for you.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.