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

  1. // Persistence Of Vision raytracer version 3.0 sample file.
  2. // File by Steve Demlow
  3. // Recursive Menger Sponge demo #1
  4.  
  5. // Recursively defines a Menger sponge (made of whatever object is specified
  6. // by the user).  The recursion is done by recursively including sponge1.inc.
  7. // Since there is no notion of private data, the state of all data must
  8. // be restored to its original calling value when a level of recursion
  9. // is finished.
  10. //
  11. // This implementation is the simplest, most elegant, and most flexible,
  12. // but also parses far slower than sponge2 and sponge3.  It renders much
  13. // faster than sponge3 and not much slower than sponge2.
  14.  
  15. #version 3.0
  16. global_settings { assumed_gamma 2.2 }
  17. background { color red 0 green 0 blue 1 }
  18.  
  19. camera {
  20.     location <1.75,0.9,1>
  21.     direction <0,1.5,0>
  22.     up <0,1,0>
  23.     look_at <0,-0.1,0>
  24. } // camera
  25.  
  26. light_source { <6, 2, 3> color rgb 0.9 }
  27.  
  28. // Define "parameters" for the Menger sponge "function"
  29.  
  30. #declare SpongeTxt = texture { pigment { color green 1.0 } }
  31. #declare SpongeCen = <0,0,0>
  32. #declare SpongeRad = 4.5 / 4.0  // Determined by XYZ->RGB mapping in sponge.inc
  33. #declare SpongeLevel = 2 // Controls recursion depth, & hence sponge complexity
  34. #declare SpongeObj = box { <-1,-1,-1>,<1,1,1> }
  35. #declare SpongeCounter = 0
  36.  
  37. // Make top-level "call" to recursive sponge generator
  38.  
  39. #include "sponge1.inc"
  40.  
  41. #debug concat("\nRendering sponge with ", str(SpongeCounter,1,0),
  42.     " primitives...\n")
  43.