home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / POV-Ray 3.0.2 / Scenes / Zonohedra / CYLLO.inc next >
Encoding:
Text File  |  1997-06-10  |  655 b   |  25 lines  |  [TEXT/POV3]

  1. #declare J = 1 //initialize outer loop
  2. #declare CYLLOHEDRON =
  3. union{
  4.  
  5. sphere{NORTH B texture{T1}}
  6. sphere{SOUTH B texture{T1}}
  7.  
  8. #while (J <= N)
  9. #declare K = 1
  10. #declare MARK = NORTH //a "point of reference" for the objects
  11. #declare R = <A * cos(J*2*pi/N), A * sin(J*2*pi/N), -RISE>
  12. cylinder{NORTH,NORTH+R C texture{T2}}
  13. cylinder{SOUTH,SOUTH-R C texture{T2}}
  14. sphere{SOUTH-R B texture{T1}}
  15.     #while (K < N-1)
  16.     #declare S = <A * cos((J+K)*2*pi/N), A * sin((J+K)*2*pi/N), -RISE>
  17.     sphere{MARK+R B texture{T1}}
  18.     cylinder{MARK+R,MARK+R+S C texture{T2}}
  19.     cylinder{MARK+S,MARK+R+S C texture{T2}}
  20.     #declare MARK = MARK+S
  21.     #declare K = K+1
  22.     #end
  23. #declare J = J+1
  24. #end
  25. }