home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / raytrace / rayce27 / papercl.r < prev    next >
Encoding:
Text File  |  1994-01-22  |  2.4 KB  |  124 lines

  1. /*
  2.   paperclip, mimicked from the Cook/Porter/Carpenter article if you
  3.   remove all the "sturm" keywords, and use the "zoom" camera, it makes
  4.   a great demo of the quartics numerical inaccuracies.
  5.  
  6.   It looks pretty good at 640x400x50 iterations, but you could do with
  7.   less rays per pixel, especially if you use a higher resolution
  8.  
  9.   HWN
  10. */
  11.  
  12.  
  13. #include "colors.inc"
  14. #include "shapes.inc"
  15.  
  16. #declare final = camera {
  17.   location <-6, 7, -20>
  18.   look_at <0, 0, 0>
  19.   sky <0, 1, 0>
  20.   fov 20
  21.   aspect 1.0
  22. }
  23.  
  24. #declare zoom = camera {
  25.   location <-3, 6, -10>
  26.   look_at <0, 1.5, 0>
  27.   sky <0, 1, 0>
  28.   fov 18
  29. }
  30.  
  31. camera { final }
  32.  
  33. options {
  34.   background y color Grey20
  35.   iterations 16
  36.   antialias 1.0
  37.   tolerance 0.007
  38. }
  39.  
  40. #declare Wood_Finish = texture {
  41.     reflection color Grey80
  42.     reflect_angle 3
  43.     diffuse color Brown diffuse 0.45
  44.     ambient color Brown ambient 0.05
  45. }
  46.  
  47. #declare table = object {
  48.   polygon { <-20, 0, 7>, <7, 0, 7>, <7, 0, -12>, <-20, 0, -12> }
  49.   texture { Wood_Finish }
  50. }
  51.  
  52. #declare paperclip = object {
  53.   union {
  54.     intersection {
  55.       torus { 0.3, 0.05 sturm rotate <90,0,0> }
  56.       plane { <0, 1, 0>, 0 }
  57.     }
  58.     cylinder {    <-0.3, 0, 0>, <-0.3, 2, 0>, 0.05    }
  59. /*      intersection {
  60.       Y_Disk
  61.       scale <0.05, 2, 0.05>
  62.           translate <-0.3, 0, 0>
  63.       }
  64. */
  65.     cylinder {    <0.3, 0, 0>, <0.3, 1.25, 0>, 0.05}
  66.   /*  intersection {  Y_Disk
  67.       scale <0.05, 1.25, 0.05>
  68.       translate <0.3, 0, 0>
  69.     }*/
  70.     intersection {
  71.       torus { 0.25, 0.05 sturm rotate <90,0,0> }
  72.       plane { <0, -1, 0>, 0 }
  73.       translate <-0.05, 2, 0>
  74.     }
  75.     cylinder { <0.2, 0.5, 0>, <0.2, 2.0,0>, 0.05 }
  76. /*    intersection {
  77.       Y_Disk
  78.       scale <0.05, 1.5, 0.05>
  79.       translate <0.2, 0.5, 0>
  80.     }
  81.   */  intersection {
  82.       torus { 0.2, 0.05 sturm rotate <90,0,0> }
  83.       plane { <0, 1, 0>, 0 }
  84.       translate <0, 0.5, 0>
  85.     }
  86.     cylinder { <-0.2, 0.5, 0>, <-0.2, 1.25,0>, 0.05 }
  87. /*    intersection {
  88.       Y_Disk
  89.       scale <0.05, 0.75, 0.05>
  90.       translate <-0.2, 0.5, 0>
  91.     }*/
  92.   }
  93.   
  94.   texture {
  95.     specular color rgb 0.5 * <color White>
  96.     roughness 0.15
  97.     diffuse color White diffuse 0.35
  98.     ambient color White ambient 0.07
  99.   }
  100.   
  101.   bounded_by { box { <-0.55, -0.35, 0.1>, <0.55, 2.55, -0.1> } }
  102.   translate <0, 0.35, 0>
  103. }
  104.  
  105. object { paperclip }
  106.  
  107. object { table }
  108.  
  109. object {
  110.   light_source {
  111.     <-6, 13, -13>
  112.     color Gray40
  113.     radius 2
  114.   }
  115. }
  116.  
  117. object {
  118.   light_source {
  119.     <0, 10, 40>
  120.     color White
  121.     radius 3
  122.   }
  123. }
  124.