68 lines
1.6 KiB
POVRay
68 lines
1.6 KiB
POVRay
|
#version 3.7;
|
||
|
#include "colors.inc"
|
||
|
#include "rand.inc"
|
||
|
|
||
|
global_settings {
|
||
|
assumed_gamma 1.8
|
||
|
}
|
||
|
|
||
|
camera {
|
||
|
right 1.78*x
|
||
|
location <-25, -75.1, -60>
|
||
|
look_at 0.1
|
||
|
angle 30
|
||
|
}
|
||
|
|
||
|
background { color rgb <.46, .09, .06> }
|
||
|
|
||
|
light_source { <300, 300, -1000> White }
|
||
|
|
||
|
#declare half_torus = difference {
|
||
|
torus {
|
||
|
4,1
|
||
|
sturm
|
||
|
rotate x*-90 // so we can see it from the top
|
||
|
}
|
||
|
box { <-5, -5, -1>, <5, 0, 1> }
|
||
|
}
|
||
|
#declare chain_segment = cylinder { <0,4,0>, <0,-4,0>, 1 }
|
||
|
|
||
|
#declare flip_it = x*180;
|
||
|
#declare torus_trans = 8;
|
||
|
#declare link_trans = torus_trans*2-2*y;
|
||
|
|
||
|
#declare chain_texture = texture {
|
||
|
pigment { color rgb <.49, .56, .59> }
|
||
|
finish {
|
||
|
ambient .1
|
||
|
diffuse .4
|
||
|
reflection .35
|
||
|
specular 1
|
||
|
metallic
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#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
|
||
|
}
|
||
|
|
||
|
|
||
|
//======= RENDER
|
||
|
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 < 10, 30, 20 > rotate y*30 }
|
||
|
|