ProjectionD.dpr 1.1 KB

123456789101112131415161718192021222324252627282930
  1. (* Parallel projection demo.
  2. This simple demo shows how to do parallel projection and blend some custom
  3. OpenGL calls into the scene.
  4. You can change the viewpoint with left clic drags, change the plane orientation
  5. with right clic drags, and move the plane up/down with the wheel.
  6. The points and plane are rendered directly with regular scene objects,
  7. but the projection lines between the points and the plane are computed
  8. and rendered on the fly in a TGLDirectOpenGL. This is a typical case where
  9. a little bit of custom code helps a lot: we could have used many TGLLines
  10. object to draw the lines, but this would have resulted in a lot of object
  11. creation and update code, and ultimately in rather poor performance.
  12. Note the position of the plane in the scene hierarchy: it is last as it is
  13. a blended object. Try making it the first object, it will appear opaque
  14. (though it is still transparent!).
  15. *)
  16. program ProjectionD;
  17. uses
  18. Forms,
  19. fdProjection in 'fdProjection.pas' {FormProjection};
  20. {$R *.res}
  21. begin
  22. Application.Initialize;
  23. Application.CreateForm(TFormProjection, FormProjection);
  24. Application.Run;
  25. end.