13,825
社区成员
发帖
与我相关
我的任务
分享
begin
{ Create 3D viewport and layer }
V := TViewport3D.Create(Self);
V.Parent := Self;
V.Align := TAlignLayout.alClient;
V.Color := claNull;
L := TLayer3D.Create(Self);
L.Parent := V;
L.Projection := TProjection.pjScreen;
L.Align := TAlignLayout.alClient;
{ Move object to 3D scene}
ScaleRoot.Parent := L;
{ Animate }
L.AnimateFloat('Position.Z', 500, 1);
L.AnimateFloatDelay('Position.Z', 0, 1, 1);
L.AnimateFloatWait('RotationAngle.X', 360, 2, TAnimationType.atInOut, TInterpolationType.itBack);
{ Back to 2D }
ScaleRoot.Parent := Self;
{ Free 3D }
L.Free;
V.Free;
end;
TViewport3D *V;
TLayer3D *L;
V = new TViewport3D(this);
V->Parent = this;
V->Align = TAlignLayout::alClient;
V->Color = claNull;
L = new TLayer3D(this);
L->Parent = V;
L->Projection = TProjection::pjScreen;
L->Align = TAlignLayout::alClient;
Layout1->Parent = L;
L->AnimateFloat("Position.Z",500,1);
L->AnimateFloatDelay("Position.Z",0,1,1);
L->AnimateFloatWait("Position.X",360,2, TAnimationType::atInOut, TInterpolationType::itBack);
Layout1->Parent = this;
L->Free();
V->Free();