pr-demo.sl 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. % PR-DEMO.SL: A small 3D Picture RLISP demo file, using LISP syntax
  2. % Is equivalent to the PR-DEMO.RED form in RLISP syntax
  3. % Use (LAPIN "PU:PR-DEMO.SL") for best effects
  4. (LOAD PRLISP)
  5. % First call the xxx!.INIT routine,
  6. (HP!.INIT) % For HP2648a
  7. % Define a 20 x 20 square
  8. (SETQ OUTLINE
  9. (POINTSET (ONEPOINT 10 10)
  10. (ONEPOINT -10 10)
  11. (ONEPOINT -10 -10)
  12. (ONEPOINT 10 -10)
  13. (ONEPOINT 10 10)))
  14. % and an Arrow to place in square
  15. (SETQ ARROW
  16. (GROUP (POINTSET (ONEPOINT 0 -1) (ONEPOINT 0 2))
  17. (POINTSET (ONEPOINT -1 1) (ONEPOINT 0 2) (ONEPOINT 1 1))))
  18. % to produce the CubeFace. Will be shifted out by 10 units
  19. (SETQ CUBEFACE (TRANSFORM (GROUP OUTLINE ARROW) (ZMOVE 10)))
  20. % to produce a 20 x 20 x 20 Cube
  21. (SETQ CUBE
  22. (GROUP CUBEFACE
  23. (TRANSFORM CUBEFACE (XROT 180))
  24. (TRANSFORM CUBEFACE (YROT 90))
  25. (TRANSFORM CUBEFACE (YROT -90))
  26. (TRANSFORM CUBEFACE (XROT 90))
  27. (TRANSFORM CUBEFACE (XROT -90))))
  28. % This is a bigger cube to be seen more clearly
  29. (SETQ BIGCUBE (TRANSFORM CUBE (SCALE 5)))
  30. % as can be seen
  31. (ESHOW BIGCUBE)
  32. % Some more views of the CUBE
  33. (ESHOW
  34. (TRANSFORM (TRANSFORM (TRANSFORM BIGCUBE (XROT 20)) (YROT 30)) (ZROT 10)))
  35. (ESHOW
  36. (TRANSFORM (TRANSFORM (TRANSFORM CUBE (SCALE 2)) (XMOVE -240))
  37. (REPEATED 5 (XMOVE 80))))
  38. % Draw a circle
  39. (ESHOW (TRANSFORM (ONEPOINT 10 10) (CIRCLE 70)))
  40. % and another
  41. (SHOW (TRANSFORM (TRANSFORM (ONEPOINT 10 10) (CIRCLE 50))
  42. (XMOVE 20)))
  43. % Define Some control points for Bspline and Bezier
  44. (SETQ CPTS
  45. (POINTSET (ONEPOINT 0 0)
  46. (ONEPOINT 70 -60)
  47. (ONEPOINT 189 -69)
  48. (ONEPOINT 206 33)
  49. (ONEPOINT 145 130)
  50. (ONEPOINT 48 130)
  51. (ONEPOINT 0 84)))
  52. % And show the BSPLINE and BEZIER curves
  53. (ESHOW (GROUP CPTS (TRANSFORM CPTS (BEZIER))))
  54. (ESHOW (GROUP CPTS (TRANSFORM CPTS (BSPLINE))))