|
実行結果 |
適用状況:
課題:
方法:
機能仕様:
unit CubeTestUnit ;
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 ;
type
TForm1 = class( TForm )
Viewport3D1 : TViewport3D ;
Dummy1 : TDummy ;
Light1 : TLight ;
LightMaterialSource1 : TLightMaterialSource ;
procedure FormCreate( Sender : TObject ) ;
private
{ private 宣言 }
public
{ public 宣言 }
end ;
var
Form1 : TForm1 ;
implementation
{$R *.fmx}
procedure TForm1.FormCreate( Sender : TObject ) ;
// ================================================
//
// ================================================
const
W = 10 ;
H = 5 ;
Z = 10 ;
S = 1.2 ;
var
I , J , K : Integer ;
img : TControl3D ;
begin
BeginUpdate ;
for I := 1 to W do
for J := 1 to H do
for K := 1 to Z do
begin
img := TCube.Create( nil ) ;
img.Parent := Dummy1 ;
TCube( img ).MaterialSource := LightMaterialSource1 ;
img.SetSize( 0.95 , 0.95 , 0.95 ) ;
img.Position.Point := Point3D( - W / 2 * S + I * S , 1 + H / 2 * S - J * S , K * S ) ;
end ;
EndUpdate ;
end ;
end.