RayCastD.dpr 1014 B

123456789101112131415161718192021222324252627282930
  1. {: Demo/sample/testbed for RayCastIntersect.
  2. The RayCastIntersect aims at determining an as precise as possible collision
  3. detection between a ray and and object. With the intersection point is also
  4. returned the normal (which can be used for things like bouncing).
  5. In this sample, this mechanism is used to implement a two-cents-worth
  6. raytracer, simply by throwing rays for each point in a raster image.
  7. That is what raytracers do, but they go beyond throwing simple rays ;)
  8. The intersection's normal and intersected object's material are then used
  9. to calculate a basic lighting.
  10. To calculate the raytraced/raycasted image, just hit the "cast" button.
  11. Note: the quadric solver used for calculating torus intersection lacks
  12. precision and may demonstrate small holes...
  13. }
  14. program RayCastD;
  15. uses
  16. Forms,
  17. fRayCastD in 'fRayCastD.pas' {FormRayCast};
  18. {$R *.RES}
  19. begin
  20. Application.Initialize;
  21. Application.CreateForm(TFormRayCast, FormRayCast);
  22. Application.Run;
  23. end.