home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #7 / amigamamagazinepolishissue1998.iso / varia / povray3 / povray3_060 / pov3demo / recurse / pyramid.inc next >
Text File  |  1997-12-12  |  984b  |  44 lines

  1. // recursive subroutine for PYRAMID.POV
  2.  
  3. // #debug str(level,4,0)
  4.  
  5. sphere { <x_pos, y_pos, z_pos>, radius_max }
  6.  
  7. #if (level > 0)
  8.   #declare level      = level - 1
  9.   #declare radius_max = radius_max / 2
  10.  
  11.   // z+
  12.   #declare z_pos = z_pos + radius_max * 3
  13.   #include "pyramid.inc"
  14.   #declare z_pos = z_pos - radius_max * 3
  15.  
  16.   // z-
  17.   #declare z_pos = z_pos - radius_max * 3
  18.   #include "pyramid.inc"
  19.   #declare z_pos = z_pos + radius_max * 3
  20.  
  21.   // x+
  22.   #declare x_pos = x_pos + radius_max * 3
  23.   #include "pyramid.inc"
  24.   #declare x_pos = x_pos - radius_max * 3
  25.  
  26.   // x-
  27.   #declare x_pos = x_pos - radius_max * 3
  28.   #include "pyramid.inc"
  29.   #declare x_pos = x_pos + radius_max * 3
  30.  
  31.   // y+
  32.   #declare y_pos = y_pos + radius_max * 3
  33.   #include "pyramid.inc"
  34.   #declare y_pos = y_pos - radius_max * 3
  35.  
  36.   // y-
  37.   #declare y_pos = y_pos - radius_max * 3
  38.   #include "pyramid.inc"
  39.   #declare y_pos = y_pos + radius_max * 3
  40.  
  41.   #declare level = level + 1
  42.   #declare radius_max = radius_max * 2
  43. #end
  44.