home *** CD-ROM | disk | FTP | other *** search
/ Chestnut's Multimedia Mania / MM_MANIA.ISO / graphics / povscn20 / hfclip.pov < prev    next >
Text File  |  1993-09-27  |  3KB  |  92 lines

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