home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #7 / amigamamagazinepolishissue1998.iso / varia / povray3 / povray3_fpu / pov3demo / recurse / sponge2.pov < prev    next >
Text File  |  1997-12-12  |  2KB  |  43 lines

  1. // Persistence Of Vision raytracer version 3.0 sample file.
  2. // File by Steve Demlow
  3. // Recursive Menger Sponge demo #2
  4.  
  5. // Recursively defines a Menger sponge.  The recursion is done by recursively
  6. // including sponge2.inc.  Since there is no notion of private data, the state
  7. // of all data must be restored to its original calling value when a level of
  8. // recursion is finished.
  9. //
  10. // This implementation treats SpongeLevel = 1 as a special case to avoid
  11. // a level of recursive calls at the bottom of the recursion tree, which
  12. // saves a lot of parse time.  It also substitutes a difference composed of
  13. // four boxes in place of the 20 boxes that are used in sponge1.inc.  This
  14. // method is faster but less flexible (you can't specify your own object).
  15.  
  16. #version 3.0
  17. global_settings { assumed_gamma 2.2 }
  18. background { color red 0 green 0 blue 1 }
  19.  
  20. camera {
  21.     location <1.75,0.9,1>
  22.     direction <0,1.5,0>
  23.     up <0,1,0>
  24.     look_at <0,-0.1,0>
  25. } // camera
  26.  
  27. light_source { <6, 2, 3> color rgb 0.9 }
  28.  
  29. // Define "parameters" for the Menger sponge "function"
  30.  
  31. #declare SpongeTxt = texture { pigment { color green 1.0 } }
  32. #declare SpongeCen = <0,0,0>
  33. #declare SpongeRad = 4.5 / 4.0  // Determined by XYZ->RGB mapping in sponge.inc
  34. #declare SpongeLevel = 2 // Controls recursion depth, & hence sponge complexity
  35. #declare SpongeCounter = 0
  36.  
  37. // Make top-level "call" to recursive sponge generator
  38.  
  39. #include "sponge2.inc"
  40.  
  41. #debug concat("\nRendering sponge with ", str(SpongeCounter,1,0),
  42.     " primitives...\n")
  43.