Example: |
The following tiny program shows how to use the 3D rotation tool. It fills the data table RotaData with some artificial data occupying three spherical clusters, sets several parameters of the 3D rotation tool and finally starts the automatic rotation:
program Rot3DTest;
const
NVARS = 5;
NOBJS = 200;
NCLASSES = 4;
var
i,j : integer;
begin
Rot3DGui (100,100,1200,700,false);
// create some nonsense data and fill the RotaData table
FrmRot3D.RotaData.Resize (NVARS,NOBJS);
for i:=1 to NOBJS do
begin
FrmRot3D.RotaData.RowAttrib[i] := 1+(i mod NCLASSES); // classes
for j:=1 to NVARS do
FrmRot3D.RotaData.Elem[j,i] := (i mod 2)+ // data points
(i mod NCLASSES)+
NRand (0.50);
end;
SetClassColor (4,$A77AA7); // adjust color of class 4
FrmRot3D.VarList := [3,2,4]; // indices of displayed columns
FrmRot3D.UseClassColors := true;
FrmRot3D.IsometricAxes := true;
FrmRot3D.Magnification := 1.2;
FrmRot3D.RotaData.ColName[3] := 'Var 3'; // change a variable name
FrmRot3D.SymbolIndex := 14;
FrmRot3D.BoundBoxSize := 900;
FrmRot3D.BoundBoxStyle := bbFaces;
FrmRot3D.MouseAction := maRotate;
FrmRot3D.AutoRotate (true, false, 4,5); // start auto rotation
end.
|