Column.dpr 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. (* This form showcases runtime object creation and framerate independant motion.
  2. We start with an almost empty scene. The dummy cube is used as a convenient
  3. way to orient the camera (using its TargetObject property). Planes are
  4. programmatically added to the scene in FormCreate and spinned in the
  5. GLCadencer1Progress event.
  6. Framerate independance motion is obtained by using a clock reference (in
  7. this sample, it is given by the TGLCadencer, which uses the high performance
  8. precision counter as reference). You can check it by resizing the window :
  9. whatever the framerate, the spin speed is the same.
  10. In this sample, it is extremely simply done, but with more complex scenes
  11. and movements the same rule applies : for framerate independant motion, you
  12. need a clock measurement.
  13. Using the TGLCadencer is the standard way for animating under GLScene, it
  14. offers various option and can drive animation automatically or just act as
  15. a manual trigger. Basic use just involves dropping a cadencer and adjusting
  16. its "Scene" property.
  17. Note that measured framerates are 1 sec averages, a TTimer is used to refresh
  18. and reset FPS counter.
  19. *)
  20. program Column;
  21. uses
  22. Forms,
  23. fColumn in 'fColumn.pas' {FormColumn};
  24. {$R *.RES}
  25. begin
  26. Application.Initialize;
  27. Application.CreateForm(TFormColumn, FormColumn);
  28. Application.Run;
  29. end.