Animation in Plot component

December 12 2011 by Robert Israel 6032
false
Maple

1


I want to have a Plot component display animations, controlled by a button. I want each click
of the button to show a new animation.

So e.g. the Action when Clicked for the button might be something like this (for animations alternately in blue and red):

use DocumentTools, plots in

if cc = red then cc:= blue else cc:= red fi;
Do(%Plot0 =animate(plot,[sin(x+t),t=0..Pi,colour=cc],x=0..Pi,frames=4));
SetProperty(Plot0,play,true,refresh=true)

end use;

The problem is that when the button is clicked, the Plot component first reverts to the first frame
of the last animation before switching to the new animation.  Any ideas on how I can prevent this?

 
Loading Comments & Answers

You must be logged into your MaplePrimes account in order to post a comment. If you don't have an account, you can create an account here.

     

Forgot Your Password? Create an Account