home *** CD-ROM | disk | FTP | other *** search
/ Computerspiele Selbermachen / computerspieleselbermachen.iso / pov / mmshape.inc < prev    next >
Text File  |  1993-09-27  |  4KB  |  218 lines

  1. // Persistence Of Vision raytracer version 2.0 sample file.
  2.  
  3. // non-Standard shapes #include file
  4. // 
  5.  
  6. #declare Ellipsoid = quadric {
  7.    <1.0, 1.0, 1.0>,
  8.    <0.0, 0.0, 0.0>,
  9.    <0.0, 0.0, 0.0>,
  10.    -1.0
  11. }
  12.  
  13. #declare light = light_source { <0, 0, 0> color White }
  14.  
  15. #declare USphere = intersection {
  16.    sphere { <0, 0, 0>, 1 }
  17.    plane { y, 0 inverse }
  18. }
  19.  
  20.  
  21. #declare DSphere = intersection {
  22.    sphere { <0, 0, 0>, 1 }
  23.    plane { -y, 0 inverse }
  24. }
  25.  
  26. #declare Cylinder_X = quadric {
  27.    <0.0, 1.0, 1.0>,
  28.    <0.0, 0.0, 0.0>,
  29.    <0.0, 0.0, 0.0>,
  30.    -1.0
  31. }
  32.  
  33. #declare Cylinder_Y = quadric {
  34.    <1.0, 0.0, 1.0>,
  35.    <0.0, 0.0, 0.0>,
  36.    <0.0, 0.0, 0.0>,
  37.    -1.0
  38. }
  39.  
  40.  
  41. #declare Cylinder_Z = quadric {
  42.    <1.0, 1.0, 0.0>,
  43.    <0.0, 0.0, 0.0>,
  44.    <0.0, 0.0, 0.0>,
  45.    -1.0
  46. }
  47.  
  48.  
  49. #declare QCone_X = quadric {
  50.    <-1.0, 1.0, 1.0>,
  51.    <0.0, 0.0, 0.0>,
  52.    <0.0, 0.0, 0.0>,
  53.    0.0
  54. }
  55.  
  56.  
  57. #declare QCone_Y = quadric {
  58.    <1.0, -1.0, 1.0>,
  59.    <0.0, 0.0, 0.0>,
  60.    <0.0, 0.0, 0.0>,
  61.    0.0
  62. }
  63.  
  64.  
  65. #declare QCone_Z = quadric {
  66.    <1.0, 1.0, -1.0>,
  67.    <0.0, 0.0, 0.0>,
  68.    <0.0, 0.0, 0.0>,
  69.    0.0
  70. }
  71.  
  72. #declare DCone = /*---------CONE POINT DOWN /POINT at 000--------*/
  73. intersection {
  74.    object { QCone_Y scale <1, 1, 1> }
  75.    plane { -y, 0 }
  76.    plane { y, 1 }
  77. }
  78.  
  79. #declare UCone = /*---------CONE POINT UP /POINT at 000--------*/
  80. intersection {
  81.    object { QCone_Y scale <1, 1, 1> }
  82.    plane { y, 0 }
  83.    plane { y, -1 inverse }
  84. }
  85.  
  86. #declare BiCone = /*----2 CONES POINTS TOGETHER /POINT at 000---*/
  87. intersection {
  88.    object { QCone_Y scale <1, 1, 1> }
  89.    plane { y, 1 }
  90.    plane { y, -1 inverse }
  91. }
  92.  
  93. #declare Plane_YZ = quadric {
  94.    <0.0, 0.0, 0.0>,
  95.    <0.0, 0.0, 0.0>,
  96.    <1.0, 0.0, 0.0>,
  97.    0.0
  98. }
  99.  
  100. #declare Plane_XZ = quadric {
  101.    <0.0, 0.0, 0.0>,
  102.    <0.0, 0.0, 0.0>,
  103.    <0.0, 1.0, 0.0>,
  104.    0.0
  105. }
  106.  
  107. #declare Plane_XY = quadric {
  108.    <0.0, 0.0, 0.0>,
  109.    <0.0, 0.0, 0.0>,
  110.    <0.0, 0.0, 1.0>,
  111.    0.0
  112. }
  113.  
  114.  
  115. /* y^2 + z^2 - x = 0 */
  116. #declare Paraboloid_X = quadric {
  117.    <0.0,  1.0,  1.0>,
  118.    <0.0,  0.0,  0.0>,
  119.    <-1.0, 0.0,  0.0>,
  120.    0.0
  121. }
  122.  
  123.  
  124. /* x^2 + z^2 - y = 0 */
  125. #declare Paraboloid_Y = quadric {
  126.    <1.0,  0.0,  1.0>,
  127.    <0.0,  0.0,  0.0>,
  128.    <0.0, -1.0,  0.0>,
  129.    0.0
  130. }
  131.  
  132.  
  133. /* x^2 + y^2 - z = 0 */
  134. #declare Paraboloid_Z = quadric {
  135.    <1.0,  1.0,  0.0>,
  136.    <0.0,  0.0,  0.0>,
  137.    <0.0,  0.0, -1.0>,
  138.    0.0
  139. }
  140.  
  141.  
  142. /* y - x^2 + z^2 = 0 */
  143. #declare Hyperboloid = quadric {
  144.    < -1.0,  0.0,  1.0>,
  145.    <  0.0,  0.0,  0.0>,
  146.    <  0.0,  1.0,  0.0>,
  147.    0.0
  148. }
  149.  
  150.  
  151. #declare Hyperboloid_Y = quadric {  /* Vertical hyperboloid */
  152.    <1.0, -1.0,  1.0>,          /*                      */
  153.    <0.0,  0.0,  0.0>,         /*            \   /     */
  154.    <0.0,  0.0,  0.0>,        /* Like this:  ) (      */
  155.    -1.0                     /*            /   \     */
  156. }
  157.  
  158.  
  159. #declare Cube = intersection {
  160.    plane {  z, 1.0 }
  161.    plane { -z, 1.0 }
  162.    plane {  y, 1.0 }
  163.    plane { -y, 1.0 }
  164.    plane {  x, 1.0 }
  165.    plane { -x, 1.0 }
  166. }
  167.  
  168.  
  169. #declare Tetrahedron = intersection {
  170.    plane { -y, 1.0 }
  171.    plane {  z, 1.0 rotate -30.0*x }
  172.    plane {  x, 1.0 rotate <0.0, 30.0, 30.0> }
  173.    plane { -x, 1.0 rotate <0.0, -30.0, -30.0> }
  174. }
  175.  
  176.  
  177. #declare Disk_X = intersection {       /* Capped cylinder, Length in x axis */
  178.    object { Cylinder_X }
  179.    plane { x, 0.0 inverse }
  180.    plane { x, 1.0 }
  181. }
  182.  
  183.  
  184. #declare Disk_Y = intersection {       /* Capped cylinder, Length in y axis */
  185.    object { Cylinder_Y }
  186.    plane { y, 0.0 inverse }
  187.    plane { y, 1.0 }
  188. }
  189.  
  190.  
  191. #declare Disk_Z = intersection {       /* Capped cylinder, Length in z axis */
  192.    object { Cylinder_Z }
  193.    plane { z, 0.0 inverse }
  194.    plane { z, 1.0 }
  195. }
  196.  
  197.  
  198. #declare Hexagon = intersection {            /* Hexagonal Solid, axis along x */
  199.    plane { z, 1.0 }   /* Rotate 90 in z axis to stand up */
  200.    plane { z, 1.0 rotate  60.0*x }
  201.    plane { z, 1.0 rotate 120.0*x }
  202.    plane { z, 1.0 rotate 180.0*x }
  203.    plane { z, 1.0 rotate 240.0*x }
  204.    plane { z, 1.0 rotate 300.0*x }
  205.    plane { x, 1.0 }
  206.    plane { x, -1.0 inverse }
  207. }
  208.  
  209. #declare Rhomboid =            /* Three Dimensional 4-Sided Diamond */
  210. intersection {
  211.    plane { -x, 1.0 rotate -30.0*z }
  212.    plane {  x, 1.0 rotate -30.0*z }
  213.    plane {  z, 1.0 }
  214.    plane { -z, 1.0 }
  215.    plane {  y, 1.0 }
  216.    plane { -y, 1.0 }
  217. }
  218.