Page 1 of 1

rotate with slider

Posted: Fri Dec 10, 2004 9:46 pm
by 9340187
Hi-

We installed the trotatetool, and it worked, but what we want to do is
do rotate,elevation, etc just like in the chart edit 3D panel. That is, the rotate slider rotates, etc. we do not want to use the mouse other than
to move a slider. If there are a couple of code snippets available, that
would be fine. We do not mind working on source code and picking
it out if thats the way.

Sorry about the confusion here.

Jennifer

Posted: Mon Dec 13, 2004 7:25 am
by Marjan
Hi, Jeniffer.

All you have to do is connect slider value to appopriate Aspect3D properties and define minimum and maximum value for each slider. For example, if you want to control the rotation angle, the following code should work fine:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D := True;
  Chart1.Aspect.Orthogonal := False;

  ScrollBarRot.Min := 0;
  ScrollBarRot.Max := 360;
  ScrollBarRot.Position := Chart1.Aspect.Rotation;
end;

procedure TForm1.ScrollBarRotChange(Sender: TObject);
begin
  Chart1.Aspect.Rotation := ScrollBarRot.Position;
end;