Thema: Delphi Frage zu firemonkey

Einzelnen Beitrag anzeigen

Schuby

Registriert seit: 25. Dez 2018
93 Beiträge
 
#5

AW: Frage zu firemonkey

  Alt 29. Dez 2020, 10:50
Videos zum Programmieren sind halt so eine Sache...

Wenn du eine 3D Anwendung erstellt hast, brauchst du lediglich im OnRender des Formulars deine Zeichenbefehle einzusetzen. Beispiel für einen Würfel:
Delphi-Quellcode:
uses
  System.Math.Vectors;

procedure TFormXXX.Form3DRender(Sender: TObject; Context: TContext3D);
begin
  // Deckel
  Context.DrawLine(Vector3D(100, 200, 0), Vector3D(200, 200, 0), 1, TAlphaColorRec.Red);
  Context.DrawLine(Vector3D(200, 200, 0), Vector3D(200, 200, 100), 1, TAlphaColorRec.Red);
  Context.DrawLine(Vector3D(200, 200, 100), Vector3D(100, 200, 100), 1, TAlphaColorRec.Red);
  Context.DrawLine(Vector3D(100, 200, 100), Vector3D(100, 200, 0), 1, TAlphaColorRec.Red);
  // Seiten
  Context.DrawLine(Vector3D(100, 200, 0), Vector3D(100, 100, 0), 1, TAlphaColorRec.Red);
  Context.DrawLine(Vector3D(200, 200, 0), Vector3D(200, 100, 0), 1, TAlphaColorRec.Red);
  Context.DrawLine(Vector3D(200, 200, 100), Vector3D(200, 100, 100), 1, TAlphaColorRec.Red);
  Context.DrawLine(Vector3D(100, 200, 100), Vector3D(100, 100, 100), 1, TAlphaColorRec.Red);
  // Boden
  Context.DrawLine(Vector3D(100, 100, 0), Vector3D(200, 100, 0), 1, TAlphaColorRec.Red);
  Context.DrawLine(Vector3D(200, 100, 0), Vector3D(200, 100, 100), 1, TAlphaColorRec.Red);
  Context.DrawLine(Vector3D(200, 100, 100), Vector3D(100, 100, 100), 1, TAlphaColorRec.Red);
  Context.DrawLine(Vector3D(100, 100, 100), Vector3D(100, 100, 0), 1, TAlphaColorRec.Red);
end;
Du kannst aber auch Pfaddaten (SVG oder XAML) in FMX verwenden.

Danke, genau das war es was ich gesucht habe.



mfg Schuby
  Mit Zitat antworten Zitat