home *** CD-ROM | disk | FTP | other *** search
/ ANews 3 / AnewsCD3.iso / atari / GRAPHX / POV / 68030.060 / POV31G30 / POVRAY_3.1G / SCENES / CSG / HFCLIP.POV < prev    next >
Text File  |  1999-10-30  |  3KB  |  89 lines

  1. // Persistence Of Vision raytracer version 3.1 sample file.
  2. // File by Dan Farmer
  3. // Broken dowel, uses clipped heightfields and heightfield as a clipping
  4. // object to create the fractured end of the dowel.  Uses a Fractint
  5. // "plasma cloud" image for the heightfield.  (just about any size will do).
  6.  
  7.  
  8. global_settings { assumed_gamma 2.2 }
  9.  
  10. #include "colors.inc"
  11. #include "textures.inc"
  12. #include "shapes.inc"
  13. #include "stones.inc"
  14.  
  15. camera {
  16.    location <0, 6, -6>
  17.    direction <0, 0, 2>
  18.    right <1.333, 0, 0>
  19.    look_at <0, 0, 0>
  20. }
  21.  
  22. #declare Column_Texture = texture {
  23.    pigment {
  24.       DMFWood1                  // (or whatever its called now)
  25.       scale <0.75, 0.75, 1>     // smaller rings
  26.       rotate 89.85*x            // turn it so the rings are (almost) up
  27.    }
  28.  
  29.    finish {
  30.       ambient 0.1
  31.       diffuse 0.55
  32.    }
  33. }
  34.  
  35. // Note: using the HF_Image declaration gives an Exception 17. Why?
  36. #declare HF_Image = height_field { png "plasma2.png" }
  37.  
  38. #declare HF_Translate = <-0.5, 0, -0.5>;
  39. #declare HF_Roughness = 2;
  40. #declare HF_Scale = <6, HF_Roughness, 6>;
  41.  
  42. union {
  43.     // This first object is a heightfield clipped to a round disk shape
  44.     // and is used for the "end cap" for the cylinder object that follows.
  45.     height_field {
  46.        png "plasma2.png"
  47.        translate HF_Translate
  48.        scale HF_Scale
  49.  
  50.        clipped_by { object { Cylinder_Y } }
  51.        texture { Column_Texture }
  52.     }
  53.  
  54.     // This is essentially the inverse of the above shape; a cylinder that
  55.     // has been clipped by the same heightfield as used to create the cap
  56.     // above.  This yeilds a cylinder with a jaggy edge that mates with
  57.     // the clipped heightfield.  Note that this cylinder, while it starts
  58.     // life with an infinate length, will now be clipped on both the top
  59.     // and the bottom to the same length as the heightfield height.
  60.     object {
  61.         Cylinder_Y
  62.         clipped_by {
  63.             height_field {
  64.                 png "plasma2.png"
  65.                 translate HF_Translate
  66.                 scale HF_Scale
  67.             }
  68.         }
  69.         texture { Column_Texture }
  70.     }
  71.     // Now we've gotta "glue" a disk to the underside of the cylinder
  72.     // so that the object can be made longer.  Overall object height
  73.     // will be HF_Roughness + the Y scale used below.
  74.     object {
  75.         object { Disk_Y translate -1*y }
  76.         texture { Column_Texture }
  77.         scale <1, 3, 1>
  78.     }
  79. }
  80.   
  81. sphere { <0, 0, 0>, 100000
  82.    hollow on
  83.    pigment { Gray30 }
  84.    finish { ambient 0.75}
  85. }
  86.  
  87. light_source { <10, 50, 1> color Gray30 }
  88. light_source { <60, 50, -100> color red 1 green 1 blue 1 }
  89.