home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #7 / amigamamagazinepolishissue1998.iso / varia / povray3 / povray3_fpu / povscn / level2 / hfclip.pov < prev    next >
Text File  |  1997-12-12  |  3KB  |  89 lines

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