unit Temp;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
System.Math.Vectors, FMX.Controls3D, FMX.Objects3D, FMX.Viewport3D,
FMX.Controls.Presentation, FMX.StdCtrls;
type
TForm1 =
class(TForm)
Viewport3D1: TViewport3D;
Dummy1: TDummy;
bnAdd3DControl: TButton;
procedure bnAdd3DControlClick(Sender: TObject);
private
{ Private-Deklarationen }
procedure Klick(Sender:TObject);
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
procedure TForm1.Klick(Sender:TObject);
begin
showmessage('
Klick');
end;
procedure TForm1.bnAdd3DControlClick(Sender: TObject);
var
s:
string;
C3D: TControl3D;
begin
s := '
Sphere';
if s = '
Sphere'
then begin
C3D := TControl3D (TSphere.Create(Dummy1));
TSphere (C3D).SubdivisionsAxes := 50;
TSphere (C3D).SubdivisionsHeight := 50;
end;
if s = '
Cube'
then begin
C3D := TControl3D (TCube.Create(Dummy1));
end;
if s = '
Cone'
then begin
C3D := TControl3D (TCone.Create(Dummy1));
TCone (C3D).SubdivisionsAxes := 50;
TCone (C3D).SubdivisionsHeight := 50;
end;
C3D.
Name := C3D.ClassName + Dummy1.ChildrenCount.ToString;
C3d.Parent := Dummy1;
C3D.Width := 2;
C3D.Height := 2;
C3D.Depth := 2;
C3d.Visible := True;
C3D.Position.X := -2;
// Set Eventhandlers to react on User-Actions
{C3D.OnMouseDown := Control3DMouseDown;
C3D.OnMouseMove := Control3DMouseMove;
C3D.OnMouseUp := Control3DMouseUp;}
C3D.OnClick := Klick;
C3d.BringToFront;
Viewport3D1.Repaint;
end;
end.