Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 2217 - Polygons incorrectly filled in OpenGL
Summary: Polygons incorrectly filled in OpenGL
Status: CONFIRMED
Alias: None
Product: VCL TeeChart
Classification: Unclassified
Component: OpenGL 3D (show other bugs)
Version: 26.181203
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-29 05:24 EDT by yeray alonso
Modified: 2019-08-02 15:09 EDT (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description yeray alonso 2019-07-29 05:24:47 EDT
Here a simple example:

uses TeCanvas, TeeGLCanvas;

procedure TForm1.FormCreate(Sender: TObject);
begin
  ComboBox1.Items.Add('OpenGL');
  ComboBox1.Items.Add('GDIPlus');
  ComboBox1.ItemIndex:=0;
  ComboBox1Change(Sender);
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  case ComboBox1.ItemIndex of
    0: Draw3D1.Canvas:=TGLCanvas.Create;
    1: Draw3D1.Canvas:=TGDIPlusCanvas.Create;
  end;
end;

procedure TForm1.Draw3D1Paint(Sender: TObject; const ARect: TRect);
var c: TCanvas3D;
    tx: array[0..8] of TPoint;
begin
  c:=Draw3D1.Canvas;

  c.Pen.Style := psSolid;
  c.Pen.Color := clBlack;
  c.Pen.Width := 2;
  c.Brush.Color := clLime;
  c.Brush.Style := bsSolid;

  tx[0] := Point(100,200);
  tx[1] := Point(100,500);
  tx[2] := Point(500,500);
  tx[3] := Point(500,100);
  tx[4] := Point(400,100);
  tx[5] := Point(400,400);
  tx[6] := Point(200,400);
  tx[7] := Point(200,200);
  tx[8] := Point(100,200);

  c.PolygonWithZ(tx, 8);
end;
Comment 1 jeff@nuhertz.com 2019-08-02 15:09:54 EDT
The bug can be worked around for polygons that employ only vertical horizontal and 45 deg lines by painting the complex polygon using a series of MoveTo3D, LineTo3D, or LineWithZ commands.  I have not tried it with other line angles.  You have to zoom in to 10 (100 being no zoom) to get adequate resolution needed to avoid spaces between the lines.  Just set the zoom level back when done.

A more permanent and robust fix might be a recursive dot paint algorithm, but the above work-around is adequate for my current needs.