pov-ray/chain_loop.pov

69 lines
1.6 KiB
POVRay
Raw Normal View History

2016-03-11 19:46:23 -06:00
#version 3.7;
#include "colors.inc"
#include "rand.inc"
2014-03-09 15:24:04 -05:00
2016-03-11 19:46:23 -06:00
global_settings {
assumed_gamma 1.8
}
2014-03-09 15:24:04 -05:00
2016-03-11 19:46:23 -06:00
camera {
right 1.78*x
location <-25, -75.1, -60>
look_at 0.1
angle 30
}
2014-03-09 15:24:04 -05:00
2016-03-11 19:46:23 -06:00
background { color rgb <.25, .63, 1> }
2014-03-09 15:24:04 -05:00
2016-03-11 19:46:23 -06:00
light_source { <300, 300, -1000> White }
2014-03-09 15:24:04 -05:00
2016-03-11 19:46:23 -06:00
#declare half_torus = difference {
torus {
4,1
sturm
rotate x*-90 // so we can see it from the top
2014-03-09 15:24:04 -05:00
}
2016-03-11 19:46:23 -06:00
box { <-5, -5, -1>, <5, 0, 1> }
}
#declare chain_segment = cylinder { <0,4,0>, <0,-4,0>, 1 }
2014-03-09 15:24:04 -05:00
2016-03-11 19:46:23 -06:00
#declare flip_it = x*180;
#declare torus_trans = 8;
#declare link_trans = torus_trans*2-2*y;
2014-03-09 15:24:04 -05:00
2016-03-11 19:46:23 -06:00
#declare chain_texture = texture {
pigment { color rgb <.49, .56, .59> }
finish {
ambient .1
diffuse .4
reflection .35
specular 1
metallic
2014-03-09 15:24:04 -05:00
}
2016-03-11 19:46:23 -06:00
}
2014-03-09 15:24:04 -05:00
2016-03-11 19:46:23 -06:00
#declare chain_link = union {
object { half_torus translate y*torus_trans/2 }
object { half_torus rotate flip_it translate -y*torus_trans/2 }
object { chain_segment translate x*torus_trans/2 }
object { chain_segment translate -x*torus_trans/2 }
translate y*60
}
#declare chain = union {
#declare I = 0;
#while(I <= 8)
#declare R = mod(I,2);
object { chain_link translate -y*link_trans*I rotate y*( (90*R) + ( RRand(-30, 30, 1 ) ) ) }
#declare I = I + 1;
#end
}
2014-03-09 15:24:04 -05:00
//======= RENDER
2016-03-11 19:46:23 -06:00
object { chain scale .45 texture { chain_texture } }
object { chain scale .45 texture { chain_texture } translate < 10, -10, -20 > rotate y*20 }
object { chain scale .45 texture { chain_texture } translate < 18, -30, -20 > rotate y*22 }
object { chain scale .45 texture { chain_texture } translate < 10, 30, 20 > rotate y*30 }
2014-03-09 15:24:04 -05:00