#include "shapes.inc" #include "colors.inc" #include "textures.inc" #include "metals.inc" #include "golds.inc" #include "woods.inc" #include "stones1.inc" #include "skies.inc" #include "glass.inc" #include "wall.inc" #include "things.inc" #declare frand = 0.009; #declare rw=0.005; //rail width #declare rs=0.05; //rail something #declare rh=0.001 ; //rail height #declare tu=0.1; //target lower edge #declare to=0.4; //target upper edge #declare th=to-tu; //target height #declare td=0.03; //target detail size #declare ft=0.01; //field thickness #declare somebox = object { box { <-0.5-frand,-0.3,-.1> <-0.5+frand,-0.41,0> pigment { color rgb 0.4 } } } #declare boden_viertel = object { union{ object{ somebox } union { cylinder{ <0,0,ft> <0,0,2*ft> 0.03 texture { pigment{ color rgb 0.2 } finish {F_MetalB} } } light_source { < 0 ,0, .5*ft > color 2 fade_distance 0.3 fade_power .1 } #translate <0.44,0.44,0> } // box { // <0.5 , 0.33+rw , rh> <-.5, 0.33-rw, 0> // pigment { // color rgb<.3,0.3,0.3> // } // finish { // ambient .03 // diffuse .1 // specular .1 // roughness 0.1 // reflection { // .2 // metallic // } // } // } } } #declare myangle = 0; #declare feld_obj = object { union { difference { box { <-.5+frand, -.5+frand, -.1> <.5 - frand, .5 - frand, 0> } torus { 0.23 0.03 #rotate 90*x #translate <0,0,0.02> } sphere { <0.4,0.4,0> 0.04 } texture { Aluminum pigment { color rgb 0.7 } finish { diffuse .1 roughness .3 specular 0.2 reflection 0.3 phong 0.1 } } //#translate <.5,0.5,0> } union { #while (myangle < 4) object { #boden_viertel #rotate myangle * z * 90 } #declare myangle = myangle + 1; #end } #translate <.5,0.5,0> //dahin } } #macro iks(xx, yy) box { <0, 0, -.1> <1, 1, .2> pigment { color rgb<.8, .8, .8> } finish { phong 0.05 ambient .2 diffuse .35 } #translate } #end #macro v_wand(xx, yy) object { h_wand(0, 0) rotate 90 * z #translate } #end #macro farbe(fa) #switch (fa) #case (0) <1, 0, 0> //rot #break #case (1) <0, 0.8, 0.1> //gruen #break #case (2) <0, 0, 1> //blau #break #case (3) <0.9, 0.8, 0> //gelb #break #end #end #declare ballsize = 0.06; #declare balldim = 0.4; #macro vortex(xx, yy) union { sphere { <.5, .5, 0.2> 0.12 pigment { color rgb <0,0,0> } finish { ambient .2 diffuse .7 } //#translate <-.5, -.5, -.05> } #translate } union{ light_source { <.68, .74, .21> color balldim * #farbe(3) area_light <0.5, 0, 0> <0, 0.5, 0> 5, 5 looks_like { union { sphere { <0, 0, 0.2> ballsize pigment { color rgb #farbe(3) } finish { ambient .2 diffuse .4 } } //#translate <-.5, -.5, -.05> } } } light_source { <.73, .32, .19> color balldim * farbe(2) area_light <0.5, 0, 0> <0, 0.5, 0> 3,3 looks_like { union { sphere { <0, 0, 0.2> ballsize pigment { color rgb #farbe(2) } finish { ambient .2 diffuse .4 } } //#translate <-.5, -.5, -.05> } } } light_source { <.3, .67, .22> color balldim * farbe(1) area_light <0.5, 0, 0> <0, 0.5, 0> 3,3 looks_like { union { sphere { <0, 0, 0.2> ballsize pigment { color rgb #farbe(1) } finish { ambient .2 diffuse .4 } } } } } light_source { <.3, .26, .2> color balldim * farbe(0) area_light <0.5, 0, 0> <0, 0.5, 0> 5, 5 looks_like { union { sphere { <0, 0, 0.2> ballsize pigment { color rgb #farbe(0) } finish { ambient .2 diffuse .4 } } } } } #translate } #end #macro trgt(xx, yy, fo, fa) light_source { <.5, .5, .2> color #farbe(fa)*1.3 area_light <0.5, 0, 0> <0, 0.5, 0> 5, 5 fade_distance 2 fade_power 1 looks_like { union { #switch (fo) #case (0) merge { box { <-0.3, -0.3, tu> <.3, .3, to+td> } sphere { <-0.3,-.3,to> td } sphere { <.3,-.3,to> td } sphere { <.3,.3,to> td } sphere { <-.3,.3,to> td } cylinder { <-.3,-.3,to > <-.3,.3,to> td } cylinder { <-.3,.3,to > <.3,.3,to> td } cylinder { <.3,.3,to > <.3,-.3,to> td } cylinder { <.3,-.3,to > <-.3,-.3,to> td } #scale 0.8 } #break #case (1) // disc // blob { // threshold .001 // cylinder { // <.5, .5, tu > <.5, .5, to> 0.29, 1 // } // scale 1 // } torus { 0.23 (th)/3 #rotate 90*x #translate <0,0,(tu + to )/2> } #break #case (2) // cross merge { box { <.2, .4, tu> <.8, .6, to> } box { <.4, .2, tu> <.6, .4, to> } box { <.4, .6, tu> <.6, .8, to> } #translate <-.5, -.5, -.05> } #break #case (3) //triangle #declare ecke0 = <0,2*wz,to>; #declare ecke1 = <0.25,-wz,to>; #declare ecke2 = <-0.25,-wz,to>; merge { sphere { ecke0 td } sphere { ecke1 td } sphere { ecke2 td } cylinder { ecke0 ecke2 td } cylinder { ecke2 ecke1 td } cylinder { ecke0 ecke1 td } prism { linear_sweep linear_spline 0, // sweep the following shape from here ... -(to+td), // ... up through here 4, // the number of points making up the shape ... <0.25,-wz>, <-0.25,-wz>, <0,2*wz>, <0.25,-wz> rotate -90*x } } #break #end pigment { color rgb #farbe(fa) transmit 0.3 } finish { ambient .5 diffuse .4 roughness .01 } interior{ior 1.5} // interior { // media { // density { rgb 1 * #farbe(fa) // } // } // } } // union } #translate } #end #macro pfosten(xx, yy) // object{ // cone { // <0, 0, 0>, 2*wadi, <0, 0, .2>, wadi/2 // } // pigment { // color rgb<.3, .3, .3> // } // finish { // ambient .2 // diffuse .3 // } // #translate // } #end #macro feld(xx,yy) object { feld_obj translate } #end #macro felder() #local xx = 0; #while (xx < breite) #local yy = 0; #while (yy < breite) object { feld_obj translate } #declare yy = yy + 1; #end #declare xx = xx + 1; #end #end