How can I draw nice 3D Arrows to depict axes (a,b,c)

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
axrDegen
Newbie
Newbie
Posts: 1
Joined: Mon Jan 14, 2019 12:00 am

How can I draw nice 3D Arrows to depict axes (a,b,c)

Post by axrDegen » Mon Feb 11, 2019 8:05 pm

Hello,

How can I draw nice 3D arrows like in the attached picture?
By using the code below I only get "flat" arrows
and can't draw an arrow in Z direction:

Code: Select all

var
  tmpX,tmpY,tmpZ: Integer;
  FromPoint,ToPoint: TPoint;
begin
  tmpY := Chart.ChartYCenter + Round(Chart.Canvas.RotationCenter.Y);
  tmpX := Chart.ChartXCenter + Round(Chart.Canvas.RotationCenter.X);
  tmpZ := (Chart.Width3D div 2) + Round(Chart.Canvas.RotationCenter.Z);
  StrainChart.Canvas.Pen.Color := clRed;
  StrainChart.Canvas.Pen.Width := 4;
  StrainChart.Canvas.Pen.Style := psSolid;

  FromPoint.X := Chart.ChartRect.Left;
  FromPoint.Y := tmpY;
  ToPoint.X := Chart.ChartRect.Right;
  ToPoint.Y := tmpY;
  Chart.Canvas.Arrow(True, FromPoint, ToPoint, 50, 50, tmpZ);

  FromPoint.X := tmpX;
  FromPoint.Y := Chart.ChartRect.Bottom;
  ToPoint.X := tmpX;
  ToPoint.Y := StrainChart.ChartRect.Top;
  Chart.Canvas.Arrow(True, FromPoint, ToPoint, 50, 50, tmpZ);
Nice3DArrowsCapture.PNG
Nice3DArrowsCapture.PNG (62.85 KiB) Viewed 31 times
Flat2DArrowsCapture.PNG
Flat2DArrowsCapture.PNG (108.13 KiB) Viewed 31 times

Post Reply