-
The Famous Pendulum
I have searched and searched…. And I’ve finally gotten to a place where I’m not entirely sure what to ask, but here it goes. On my quest to master the art of expressions I am currently attempting to control the motion of a pendulum. Not the typical way however(or at least what I’ve found in my searches). What I’m attempting to do is have the pendulum swing and then with a check box control(animated) switch to the motion with the decay. To describe this, If the checkbox == 0 the pendulum is not swinging. When the checkbox == 1 the pendulum swings and when the checkbox is unchecked(pendulum still swinging) the pendulum receives the decay parameter…
Here is what I’ve come up with, however the result I get causes the pendulum to switch to just being off. Expression is applied to null rotation.
Now the expression works with either the check box ticked on or off. However I want this transition to be seamless.
Null Rotation Expression:freq = slider control;
amp = slider control;
dec = slider control;
t= time;Math.sin(t*freq*Math.PI)*amp/Math.exp(t*dec)
for Each of the slider controls:
freq = slider control;
cBox = checkbox;if ( cbox == 1){
freq = 2;
}else{
2
}In the case of the decay value:
dec = slider Control;
cBox = checkbox;if (cBox == 1){
dec = 1;
}else{
0
}