home *** CD-ROM | disk | FTP | other *** search
/ Mega A/V / mega_av.zip / mega_av / GRAPHUTL / POVSCN.ZIP / LEVEL2.ZIP / HFCLIP.POV < prev    next >
Text File  |  1992-07-18  |  3KB  |  86 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.     DMFWood1                // (or whatever its called now)
  28.     scale <0.75 0.75 1>     // smaller rings
  29.     rotate <89.85 0 0>      // turn it so the rings are (almost) up
  30.     ambient 0.1
  31.     diffuse 0.55
  32. }
  33.  
  34. // Note: using the HF_Image declaration gives an Exception 17. Why?
  35. #declare HF_Image = height_field { gif "plasma2.gif" }
  36.  
  37. #declare HF_Translate = <-0.5 0 -0.5>
  38. #declare HF_Roughness = 2
  39. #declare HF_Scale = <6 HF_Roughness 6>
  40.  
  41. composite {
  42.  
  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.     object {
  46.         height_field { gif "plasma2.gif"
  47.             translate HF_Translate
  48.             scale HF_Scale
  49.         }
  50.         clipped_by { quadric { 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.         quadric { Cylinder_Y }
  62.         clipped_by {
  63.             height_field { gif "plasma2.gif"
  64.                 translate HF_Translate
  65.                 scale HF_Scale
  66.                 inverse
  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.         intersection { Disk_Y translate <0 -1 0> }
  76.         texture { Column_Texture }
  77.         scale <1 3 1>
  78.     }
  79.  
  80. }
  81.   
  82. object { sphere { <0 0 0> 100000 } texture { color Gray30 ambient 0.75} }
  83.  
  84. object {light_source { < 10 50  1> color Gray30 }}
  85. object {light_source { < 60 50 -100> color red 1 green 1 blue 1 }}
  86.