-
Crane Pendulum Decay Swing Fun
I will freely confess that expressions are not my strong point. Although, I think my question will make that clear enough as I progress through it.
Let’s say I have a crane setup. I’ve got an arm and a hook. Like so:
/,
(Mine is a little more complicated than that, but for the sake of simplicity let’s pretend that’s all I’ve got.)I have the arm and hook psuedo-connected by a “rope” created by the Beam effect (with the start and end point of the Beam effect tied to the world positions of null objects parented to the appropriate points on the beam and hook layers). Anyway, the rope does not matter at this point.
In our situation, I want the hook to react to the motion of the arm. I want there to be inertia! A delay in the hook’s movement as the arm starts moving and a continuation of the hook’s movement past the arm’s stopping point decaying into a standstill again.
I also need the hook to be able to move up and down – this is, after all, a crane.
I am thinking that the Y position of the hook would be caused by an Expression Control slider effect. That way the expression control slider could also be used to effect the delay/decay/amplitude of the hook’s movement as it would in real life as the rope got shorter or longer.
Here’s what I’ve tried so far:
Adapting Dan’s follow the leader page I was able to get the hook to follow in a delayed manner on the x and z axis only.
delay = 5;
d = delay*thisComp.frameDuration;
follow = thisComp.layer("A Boom Track").transform.position.valueAtTime(time-d);
x = follow(0);
y = effect("Drop of hook")("Slider");
z = follow(2);
[x,y,z]I found Filip Vandueren’s decay expression here.
inertia = 0.8;
stiffness = 0.1;lagValue = calcValue(0);
f= thisComp.frameDuration;
will=0;for (t=0; t<=time; t+=f) { delta = calcValue(t) - lagValue; will = will * inertia + delta*stiffness ; lagValue +=will } lagValue; function calcValue(t) { downwardVec = toWorldVec([1,0],t); angle = -radiansToDegrees(Math.atan2(downwardVec[1],downwardVec[0])); return angle; }
However, my brain is fried at the moment and I can't figure how to apply it. I'm also not quite sure that I'm headed in the right direction.
I'd like to be able to keep the distance between the hook and the arm the same (until I animate the y slider thingy, of course).
I was thinking I could use a few null objects.
Null 1 parented at the end of the boom arm.
Null 2 below it responding to the movement of Null 1 with proper decay/inertia, etc. (responding to the hook distance slider)
Null 3 also parented at the end of the boom arm, but set to rotate so that it always orients towards Null 2.
Null 4 parented to Null 3, but offset in a downward direction by the hook distance slider.
I would then tie the hook's position to Null 4.That method, I believe would get a realistic arm and hook movement. However, my lack of knowledge is kinda screwing me at the moment.
Any ideas?
- The Great Szalam
(The 'Great' stands for 'Not So Great, in fact, Extremely Humble')No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.
Sorry, there were no replies found.