fMotionBlur2D.pas 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. unit fMotionBlur2D;
  2. interface
  3. uses
  4. System.Classes,
  5. System.SysUtils,
  6. System.Math,
  7. Vcl.Forms,
  8. Vcl.StdCtrls,
  9. Vcl.Controls,
  10. GLS.Objects,
  11. GLS.Scene,
  12. Stage.VectorTypes,
  13. GLS.Blur,
  14. GLS.SimpleNavigation,
  15. GLS.Texture,
  16. GLS.Cadencer,
  17. Stage.VectorGeometry,
  18. GLS.GeomObjects,
  19. GLS.SceneViewer,
  20. GLS.Material,
  21. GLS.Coordinates,
  22. GLS.BaseClasses, GLS.VectorFileObjects;
  23. type
  24. TFormMotionBlur2 = class(TForm)
  25. GLScene1: TGLScene;
  26. GLSceneViewer1: TGLSceneViewer;
  27. GLCadencer1: TGLCadencer;
  28. Cam: TGLCamera;
  29. Light: TGLLightSource;
  30. GLMaterialLibrary1: TGLMaterialLibrary;
  31. GLCube1: TGLCube;
  32. GLSphere1: TGLSphere;
  33. GLTorus1: TGLTorus;
  34. GLIcosahedron1: TGLIcosahedron;
  35. GLTeapot1: TGLTeapot;
  36. GLCube2: TGLCube;
  37. GLCube3: TGLCube;
  38. GLMotionBlur1: TGLMotionBlur;
  39. GLSimpleNavigation1: TGLSimpleNavigation;
  40. procedure GLCadencer1Progress(Sender: TObject; const deltaTime,
  41. newTime: Double);
  42. private
  43. public
  44. MotionBlur: TGLMotionBlur;
  45. end;
  46. var
  47. FormMotionBlur2: TFormMotionBlur2;
  48. implementation
  49. {$R *.dfm}
  50. procedure TFormMotionBlur2.GLCadencer1Progress(Sender: TObject; const deltaTime,
  51. newTime: Double);
  52. begin
  53. GLCube1.RollAngle:= GLCube1.RollAngle - 175*deltaTime;
  54. GLCube1.TurnAngle:= GLCube1.TurnAngle + 175*deltaTime;
  55. GLTorus1.RollAngle:= GLTorus1.RollAngle - 5*deltaTime;
  56. GLTorus1.TurnAngle:= GLTorus1.TurnAngle + 5*deltaTime;
  57. GLIcosahedron1.RollAngle:= GLIcosahedron1.RollAngle - 50*deltaTime;
  58. GLIcosahedron1.TurnAngle:= GLIcosahedron1.TurnAngle + 50*deltaTime;
  59. GLCube1.Position.X:=Sin(newTime+2)*8-1;
  60. GLCube1.Position.Y:=Cos(newTime+2)*2;
  61. GLCube1.Position.Z:=Cos(newTime+2)*3;
  62. GLCube2.Position.X:=Sin(newTime+2)*8-1;
  63. GLSceneViewer1.Invalidate;
  64. end;
  65. end.