home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / p / povray3a / DocsDemo / pov / TorDemo < prev   
Text File  |  1996-07-08  |  2KB  |  77 lines

  1. //
  2. // POV-Ray(tm) 3.0 tutorial example scene.
  3. // Copyright 1996 by the POV-Ray Team
  4. //
  5.  
  6. #include "colors.inc"
  7.  
  8. camera {
  9.   location <0, .1, -25>
  10.   look_at 0
  11.   angle 36
  12. }
  13.  
  14. background { color White }
  15.  
  16. light_source{ <300, 300, -1000> White }
  17.  
  18. #declare Half_Torus = difference {
  19.   torus { 4,1  
  20.     sturm
  21.     rotate x*-90  // so we can see it from the top
  22.   }
  23.   box { <-5, -5, -1>, <5, 0, 1> }
  24. }
  25.  
  26. #declare Flip_It_Over = x*180
  27. #declare Torus_Translate = 8
  28. #declare Link_Translate = Torus_Translate*2-2*y
  29.  
  30. #declare Chain_Segment = cylinder { <0, 4, 0>, <0, -4, 0>, 1 }
  31.  
  32. #declare Chain_Gold = texture {
  33.   pigment { BrightGold }
  34.   finish {
  35.     ambient .1 
  36.     diffuse .4 
  37.     reflection .25 
  38.     specular 1
  39.     metallic 
  40.   }
  41. }
  42.  
  43. #declare Link = union {
  44.   object { Half_Torus 
  45.     translate y*Torus_Translate/2 
  46.   }
  47.   object { Half_Torus 
  48.     rotate Flip_It_Over 
  49.     translate -y*Torus_Translate/2
  50.   }
  51.   object { Chain_Segment 
  52.     translate x*Torus_Translate/2
  53.   }
  54.   object { Chain_Segment 
  55.     translate -x*Torus_Translate/2
  56.   }
  57.   texture { Chain_Gold }
  58. }
  59.  
  60. #declare Link_Pair = union {
  61.   object { Link }
  62.   object { Link translate y*Link_Translate rotate y*90 }
  63. }
  64.  
  65. #declare Chain = union {
  66.   object { Link_Pair}
  67.   object { Link_Pair translate  y*Link_Translate*2 }
  68.   object { Link_Pair translate  y*Link_Translate*4 }
  69.   object { Link_Pair translate  y*Link_Translate*6 }
  70.   object { Link_Pair translate -y*Link_Translate*2 }
  71.   object { Link_Pair translate -y*Link_Translate*4 }
  72.   object { Link_Pair translate -y*Link_Translate*6 }
  73. }
  74.  
  75. object { Chain scale .1 rotate <0, 45, -45> }
  76.  
  77.