123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- unit fPointto;
- interface
- uses
- System.SysUtils,
- System.Classes,
- System.Math,
- Vcl.Graphics,
- Vcl.Controls,
- Vcl.Forms,
- Vcl.Dialogs,
- Vcl.StdCtrls,
-
- GLS.Objects,
- GLS.Scene,
- GLS.VectorTypes,
- GLS.VectorGeometry,
- GLS.Cadencer,
- GLS.SceneViewer,
- GLS.GeomObjects,
-
- GLS.Coordinates,
- GLS.BaseClasses;
- type
- TFormPointto = class(TForm)
- GLSceneViewer1: TGLSceneViewer;
- GLScene1: TGLScene;
- GLCamera1: TGLCamera;
- DCSphere: TGLDummyCube;
- ArrowLine: TGLArrowLine;
- GLLightSource1: TGLLightSource;
- Sphere: TGLSphere;
- DCArrow: TGLDummyCube;
- GLCadencer1: TGLCadencer;
- Disk1: TGLDisk;
- Disk2: TGLDisk;
- Lines1: TGLLines;
- Plane1: TGLPlane;
- Lines2: TGLLines;
- procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
- newTime: Double);
- private
- end;
- var
- FormPointto: TFormPointto;
- implementation
- {$R *.DFM}
- procedure TFormPointto.GLCadencer1Progress(Sender: TObject; const deltaTime,
- newTime: Double);
- begin
- // Make the blue sphere turn and ride a sin
- DCSphere.Turn(deltaTime*30);
- Sphere.Position.Y := Sin(DegToRad(newTime*50))*3;
- // Make the arrow turn
- DCArrow.Turn(-deltaTime*15);
- // Make the arrow point toward the sphere, using Y as up reference
- ArrowLine.PointTo(Sphere, YHmgVector);
- end;
- end.
|