Thema: Delphi Frage zu firemonkey

Einzelnen Beitrag anzeigen

Benutzerbild von jaenicke
jaenicke
Online

Registriert seit: 10. Jun 2003
Ort: Berlin
9.327 Beiträge
 
Delphi 11 Alexandria
 
#2

AW: Frage zu firemonkey

  Alt 29. Dez 2020, 09:17
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.
Sebastian Jänicke
Alle eigenen Projekte sind eingestellt, ebenso meine Homepage, Downloadlinks usw. im Forum bleiben aktiv!
  Mit Zitat antworten Zitat