Advertisement
Kroppeek

povray chain

Jun 5th, 2019
2,526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.            
  2. #version 3.6;
  3. global_settings{ assumed_gamma 1.0 }
  4. #default{ finish{ ambient 0.1 diffuse 0.9 }}
  5.  
  6. #include "colors.inc"
  7. #include "textures.inc"
  8.  
  9. #declare Camera_1 = camera { ultra_wide_angle  
  10.                              angle     48
  11.                              location  <7.7,8,-5.0>
  12.                              right     x*image_width/image_height
  13.                              look_at   <4.40, 0.00, 0.0>
  14.                            }
  15. camera{Camera_1}
  16.  
  17.  
  18. light_source{<1500,2500,-2500> color White}
  19.  
  20. sky_sphere{ pigment{  color rgb<1,1,1> }}
  21.  
  22.  
  23. #declare Metal_Texture =
  24.          texture { pigment{ color rgb<1,1,1>*0.2}
  25.                    normal { bumps 0.125 scale 0.015}
  26.                    finish { phong 0.5 reflection 0.2}
  27.                  }
  28.  
  29. #declare R_minor = 0.25;
  30. #declare R_major = 0.75;
  31. #declare Half_L = 0.25;
  32. #declare Link_Length =  2*(R_major);
  33.  
  34. #declare Left_Half =  
  35. union{
  36.  
  37.  difference{
  38.  torus { R_major, R_minor
  39.            rotate<90,0,0>  
  40.        }                
  41.  
  42.  box { <0,-R_major-R_minor,-R_minor>,< R_major+R_minor,R_major+R_minor,R_minor>
  43.      }
  44.  
  45.  translate<-Half_L,0,0>
  46.  
  47.  }
  48.  cylinder { <-Half_L,0,0>,<Half_L,0,0>, R_minor
  49.              translate<0,R_major,0>
  50.          }
  51. }                      
  52.  
  53. # declare Chain_Link =
  54. union{
  55. object{ Left_Half }
  56. object{ Left_Half scale <-1,-1,1>}
  57.         texture { Metal_Texture
  58.                 }
  59. }
  60.  
  61. union{
  62.  #declare Nr = 0;    
  63.  #declare EndNr = 6;
  64.  #while (Nr< EndNr)
  65.  
  66.    object{Chain_Link
  67.           #if ( int(Nr/2) != Nr/2 )
  68.            rotate<90,0,0>
  69.           #end
  70.            translate < Nr*Link_Length ,0,0>
  71.          }
  72.  
  73.  #declare Nr = Nr + 1;  
  74.  #end
  75.  
  76. translate<0,0,0>}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement