I have a problem with ManipulateManipulate
. I want to stop animate x variable dependingmy animation depending on a condition on the value (like if)A
, which is controlled by a manipulator. I tried AnimationRunningto do this by giving the animator specified for variable -> If[Tan[A] <= 0x
the option AnimationRunning -> If[Tan[A] <= 0.7, False, True]
.7, False, True] That stopped the animation, but that didn't stop the animation timeclock, which depends on the computer's real-clock time. So when If returns Falsethe animation is stopped, but when If state changes to Truerestarted by increasing A
above 0.7, the animation jumps to the place estimateddetermined by the current clock-animation time, which didn't stop while the graphics updating was paused.
I
I think iI need to resetstop the animation clock when the graphics updating is paused. My idea is to get access to PlayPauseButtonPlayPauseButton
to click it in code. But i have no idea how to do it..
I will be grateful for any help.
Manipulate[
Graphics[
{
{FaceForm[], EdgeForm[{Thick, Gray}], AASTriangle[Pi/2, A, 1]},
Translate[{{FaceForm[], EdgeForm[{Thickness[0.004], Blue}],
Rotate[{{Rectangle[{0, Sin[A] + 0.006}, {0.15,
Sin[A] + 0.08}]}}, -A, {0, Sin[A]}]}},
{x*Cos[A], -x*Sin[A]}
]
},
PlotRange -> {{0, 1}, {0, 1}}, Axes -> False, ImageSize -> {400, 400}
],
{{A, Pi/4, "A"}, 0.0001, Pi/2 - 0.0001},
{{x, 0}, 0, 1 - 0.15, ControlType -> Animator,
AnimationRunning -> If[Tan[A] <= 0.7, False, True],
AnimationRunTime -> Dynamic[t], AnimationTimeIndex -> Dynamic[indx]},
Dynamic[x],
Dynamic[t],
Dynamic[indx],
ControlPlacement -> Left
]