Macro illustrating how to animate a picture using a Timer.
void anim()
{
gStyle->SetCanvasPreferGL(
true);
gStyle->SetFrameFillColor(42);
f2 =
new TF2(
"f2",
"sin(2*x)*sin(2*y)*[0]", 0, pi, 0, pi);
}
void Animate()
{
if (!
gROOT->GetListOfCanvases()->FindObject(
"c1"))
return;
t += 0.05 * pi;
phi += 2;
}
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
virtual void SetNpx(Int_t npx=100)
virtual void SetMaximum(Double_t maximum=-1111)
virtual void SetMinimum(Double_t minimum=-1111)
virtual void SetParameter(Int_t param, Double_t value)
void Draw(Option_t *option="") override
Default Draw method for all objects.
virtual void SetNpy(Int_t npy=100)
Handles synchronous and a-synchronous timer events.
virtual void TurnOn()
Add the timer to the system timer list.
void SetCommand(const char *command)
Set the interpreter command to be executed at time out.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
- Author
- Rene Brun
Definition in file anim.C.