home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / p / povray3a / POV3Demo / Recurse / pov / SphrFlak < prev    next >
Text File  |  1996-03-15  |  2KB  |  45 lines

  1. // Recursively defines a sphereflake of arbitrary complexity.
  2. // Change the SFLevel value below to control the complexity of the sphereflake.
  3. //
  4. // This scene can be animated, by e.g. using '+kff29' to generate 30 frames.
  5. // The animation consists of the child sphereflakes rotating around the
  6. // axes defined by their center point and their parent's center point.
  7. //
  8. // The recursion is done by recursively including sphrflak.inc.
  9. // Since there is no notion of private data, the state of all data must
  10. // be restored to its original calling value when a level of recursion
  11. // is finished.
  12. //
  13. // "Parameters":
  14. //    SFLevel - level of recursion; recurses/decrements until 0 is reached
  15. //    SFCen - point that current sphereflake level is centered at
  16. //    SFRad - radius of current parent sphere
  17. //    SFUp - unit vector around which the child spheres are oriented
  18. //    SFRight - unit vector perpendicular to SFUp
  19. //    SFRot - rotational value for animations (in degrees)
  20.  
  21. background { color red 0 green 0 blue 1 }
  22.  
  23. camera {
  24.     location <3.5,3,2>
  25.     location <1.3,1.1,0.6>
  26.     direction <0,1.5,0>
  27.     up <0,1,0>
  28.     look_at <0,0.1,0>
  29. } // camera
  30.  
  31. light_source { <6, 5, 3> color rgb 0.9 }
  32.  
  33. // Define "parameters" for the sphereflake "function"
  34.  
  35. #declare SFCen = <0,0,0>
  36. #declare SFUp = <0,1,0>
  37. #declare SFRight = <1,0,0>
  38. #declare SFRad = 1 / 3
  39. #declare SFRot = clock * 360       // Animate sphereflake at each level!
  40. #declare SFLevel = 2     // Controls recursion depth, & hence model complexity
  41.  
  42. // Make top-level "call" to recursive sphereflake generator
  43.  
  44. #include "sphrflak.inc"
  45.