Page 1 of 1

Animating a Surface Plot

Posted: Thu Nov 17, 2016 4:11 pm
by 16479009
I would like to animate the Surface Plot so that it tilts in various directions and orientation for a period of time. I have found a rotation tool in the animation presets but it only rotates on the horizontal plane. How do I acheive the former effect (or, at least, is it possible)?

Re: Animating a Surface Plot

Posted: Fri Nov 18, 2016 9:44 am
by yeray
Hello,

You could put a TTimer and change the Chart.Aspect.Rotation and Chart.Aspect.Elevation as you wish. Ie:

Code: Select all

uses TeeSurfa;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.AddSeries(TSurfaceSeries).FillSampleValues();

  Chart1.Aspect.Orthogonal:=false;
  Chart1.Chart3DPercent:=100;
  Chart1.Legend.Visible:=false;
  Chart1.Aspect.Zoom:=80;

  Chart1.Walls.Visible:=false;
  Chart1.Axes.Visible:=false;

  Timer1.Interval:=100;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  Chart1.Aspect.Elevation:=Chart1.Aspect.Elevation+10 mod 360;
  Chart1.Aspect.Rotation:=Chart1.Aspect.Rotation+10 mod 360;
end;