Particles.dpr 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. {: Basic particle system.
  2. This is a very basic use of the particle systems in GLScene : colored
  3. alos (sprites) are created randomly with fade-in and fade-out effects, and
  4. the whole particle system rotates slowly (particles do not move in this
  5. sample). Particles live for 10 seconds, and are created every 300 ms.
  6. An inertia behaviour takes care of the rotation and cadencer makes the whole
  7. thing move.
  8. TGLParticles works with a "template", this the mother of all particles, and
  9. it is duplicated when a new particle is requested. The template is the
  10. first (top) child of TGLParticles, other children are considered to be
  11. particles (don't temper directly with TGLParticles children !). In this
  12. sample, a sprite is the only child, and as such make a simple particle
  13. template, particles can be very complex : if the sprite was having children,
  14. these would be part of the particle too, and their children and the children
  15. of their children and... you got it.
  16. Some eye candy here, but if you don't have a 3D hardware, reduce the window
  17. size to avoid slowdown. This one could make a nice screen-saver, this is
  18. left as an exercice to reader (hint : you just need to drop 1 component,
  19. type in 3 characters and press CTRL+F9).
  20. }
  21. program Particles;
  22. uses
  23. Forms,
  24. fParticles in 'fParticles.pas' {FormParticles};
  25. {$R *.RES}
  26. begin
  27. Application.Initialize;
  28. Application.CreateForm(TFormParticles, FormParticles);
  29. Application.Run;
  30. end.