unit Space; interface uses System.SysUtils, System.Types, System.UITypes, System.Rtti, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Types3D, FMX.Materials, FMX.Objects3D, FMX.Layers3D; type TForm1 = class(TForm3D) Sphere1: TSphere; LightMaterialSource1: TLightMaterialSource; Light1: TLight; Dummy1: TDummy; Sphere2: TSphere; LightMaterialSource2: TLightMaterialSource; Timer1: TTimer; Sphere3: TSphere; TextureMaterialSource1: TTextureMaterialSource; Camera1: TCamera; Layer3D1: TLayer3D; Label1: TLabel; Label2: TLabel; Label3: TLabel; Mars: TSphere; LightMaterialSource3: TLightMaterialSource; LightMaterialSource4: TLightMaterialSource; Dummy2: TDummy; Plane1: TPlane; LightMaterialSource5: TLightMaterialSource; procedure Timer1Timer(Sender: TObject); procedure Form3DCreate(Sender: TObject); procedure Form3DKeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); procedure Form3DMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean); private { Private declarations } public { Public declarations } end; const AstroDecimal : single = 149.6; var Form1 : TForm1; corner : single; r : single; implementation {$R *.fmx} procedure TForm1.Form3DCreate(Sender: TObject); begin corner := 2*pi; r := 13.0; end; procedure TForm1.Form3DKeyDown(Sender: TObject; var Key: Word; var KeyChar: Char; Shift: TShiftState); begin case Key of vkUp : Camera1.Position.Y := Camera1.Position.Y + 0.9; vkDown : Camera1.Position.Y := Camera1.Position.Y - 0.9; vkLeft : Camera1.Position.X := Camera1.Position.X + 0.9; vkRight: Camera1.Position.X := Camera1.Position.X - 0.9; vkNumpad4 : Camera1.RotationCenter.X := Camera1.RotationCenter.X - 0.9; vkNumpad6 : Camera1.RotationCenter.X := Camera1.RotationCenter.X + 0.9; vkF1 : Camera1.Position.Z := Camera1.Position.Z - 0.9; vkF2 : Camera1.Position.Z := Camera1.Position.Z + 0.9; end; end; procedure TForm1.Form3DMouseWheel(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean); begin if WheelDelta > 0 then Camera1.Position.Z := Camera1.Position.Z + 0.9 else Camera1.Position.Z := Camera1.Position.Z - 0.9; end; procedure TForm1.Timer1Timer(Sender: TObject); begin //if corner = 2* pi then //corner := 0; Sphere3.Position.X := r*cos(corner); Sphere3.Position.Y := r*sin(corner); Sphere3.Position.Z := - corner; corner := corner - 0.01; Sphere1.RotationAngle.Y := Sphere1.RotationAngle.Y + 0.3; Sphere2.RotationAngle.Y := Sphere2.RotationAngle.Y + 0.2; Mars.RotationAngle.Y := Mars.RotationAngle.Y + 0.3; Label1.Text := 'X : ' + IntToStr(Round(Sphere3.Position.X)); Label2.Text := 'Y : ' + IntToStr(Round(Sphere3.Position.Y)); Label3.Text := 'Z : ' + IntToStr(Round(Sphere3.Position.Z)); end; end.