#version 3.5; #include "colors.inc" #include "textures.inc" #include "shapes.inc" #include "rand.inc" #include "woods.inc" #include "stones.inc" global_settings { assumed_gamma 1.0 } #macro Cambia () translate <-0.052,-0.052,0> rotate <0,0,90*Rand_Bernoulli(0.25,1)> translate <0.052,0.052,0> #end //#declare Modello = "opus_noce.jpg" //#declare Modello = "dakaer_beige.jpg" //#declare Modello = "forum_avorio.jpg" //#declare Modello = "forum_beige.jpg" //#declare Modello = "forum_rosa.jpg" //#declare Modello = "geos_rosato.jpg" //#declare Modello = "opus_almond.jpg" //#declare Modello = "opus_bone.jpg" //#declare Modello = "opus_dorato.jpg" #declare Modello = "forum_beige.jpg" //#declare Muro = texture { pigment { wrinkles color_map {[0.0 color rgb <1.0, 1.0, 0.666667>][1.0 color rgb <0.90, 0.80, 0.8>]}} finish{ ambient 0.4 diffuse 0.4} normal{dents 0.3 scale 0.1}} #declare Legno = T_Wood17 // pigment{Gray30} // #macro Tozzetto(xx,yy) union { object { box{<0,0,0>,} pigment {Gray30} } object { Round_Box_Merge(<0.002,0.002,0>, , 0.002) pigment { //Gray50 image_map { jpeg Modello map_type 0 once } scale <0.1,0.1,0.1> } normal { bump_map { jpeg Modello bump_size 1 } scale <0.1,0.1,0.1> } finish { phong 0.1 ambient 0.05 diffuse 0.5 } } } #end #declare Legno_V = texture { pigment { image_map { tga "c:\legno2.tga" } } normal { bump_map { gif "c:\legno2.gif" bump_size 0.05 } accuracy 0.001 } finish { phong 0.1 ambient 0.05 diffuse 0.5 } scale <0.8,1.2,1> } #declare Legno_O = texture { pigment { image_map { tga "c:\legno2.tga" } } normal { bump_map { gif "c:\legno2.gif" bump_size 0.05 } accuracy 0.001 } finish { phong 0.1 ambient 0.05 diffuse 0.5 } scale <0.8,1.2,1> rotate<0,0,90> } #declare Legno_comp = texture { planar texture_map{[0.5 Legno_O rotate<0,10,0> scale<1,0.6,1> ][0.5 Legno_O ]} frequency 7 rotate<0,0,90> } #macro Bozza (larg, alt) object { difference { box{<0.04,0.04,0>,} cylinder{<0.04,0,0>,<0.04,alt,0>,0.03 scale <1,1,0.2>} cylinder{,,0.03 scale <1,1,0.2>} cylinder{<0.04,alt-0.04,0>,,0.03 scale <1,1,0.2>} cylinder{<0.04,0.04,0>,,0.03 scale <1,1,0.2>} } texture{Legno_comp} } #end #macro Sportello (larg,alt) object { union { // montanti box{<0,0,0>,<0.04,alt,0.022> texture{Legno_V}} box{<0,0.04,0>,<0.01,alt-0.04,0.01> texture{Legno_V} rotate<0,-45,0> translate<0.04,0,0> } box{, texture{Legno_V translate<0,alt/2,0>} } box{<0,0.04,0>,<-0.01,alt-0.04,0.01> texture{Legno_V} rotate<0,45,0> translate } box{<0.04,alt-0.04,0>, texture{Legno_O}} box{<0.04,0,0>, texture{Legno_O}} box{<0.04,0,0>, texture{Legno_O}} box{<0.04,0,0>, texture{Legno_O}} //bozza Bozza(larg,alt) } translate<0,0,-0.015> } #end #macro Sportello_v (larg,alt) object { union { // montanti box{<0,0,0>,<0.04,alt,0.022> texture{Legno_V}} box{<0,0.04,0>,<0.01,alt-0.04,0.01> texture{Legno_V} rotate<0,-45,0> translate<0.04,0,0> } box{, texture{Legno_V translate<0,alt/2,0>} } box{<0,0.04,0>,<-0.01,alt-0.04,0.01> texture{Legno_V} rotate<0,45,0> translate } box{<0.04,alt-0.04,0>, texture{Legno_O}} box{<0.04,0,0>, texture{Legno_O}} box{<0.04,0,0>, texture{Legno_O}} box{<0.04,0,0>, texture{Legno_O}} //Vetro box{<0.04,0.04,0.008>, pigment {Gray10 filter 0.97} finish {phong 0.5 diffuse 0.5 reflection 0.6} normal{dents 0.2 scale 0.01} } box{<0,0,0.008>,<(larg-0.08)/1.414,(larg-0.08)/1.414,0.012> rotate<0,0,-45> translate<0.04,alt-(larg/2),-0.001> pigment {Gray30 filter 0.97} finish {phong 0.6 diffuse 0.5 reflection 0.6} } box {< (larg/2) - 0.0025, 0.04 , 0.004>,<(larg/2) + 0.0025,(alt-larg)+0.04,0.012> pigment {Silver} finish{phong 0.8}} object { difference { box{<0,0,0.004>,<(larg-0.08)/1.414,(larg-0.08)/1.414,0.012> } box{<0.005,0.005,-0.1>,<(larg-0.085)/1.414,(larg-0.085)/1.414,0.1> } } rotate<0,0,-45> translate<0.04,alt-(larg/2),-0.0015> pigment {Silver} finish{phong 0.8} } } translate<0,0,-0.015> } #end #macro Fila (xx,yy) #if (xx > yy) #if( mod ((xx/2),0.104) >= mod ((xx/2)-0.052,0.104)) // CASO 1: spigolo mattonella a metà segmento #declare Quante = int((xx/2)/0.104); #declare Resto = mod ((xx/2),0.104); #declare Inc = 1; #while (Inc <= Quante) object { Tozzetto(0.1,0.1) Cambia() translate <(xx/2) + (0.104 * (Inc-1)) ,0,0> } object { Tozzetto(0.1,0.1) Cambia() translate <(xx/2) - (0.104 * (Inc-1)) - 0.104 ,0,0> } #declare Inc=Inc+1; #end #if (Resto != 0) object {Tozzetto(Resto-0.004,0.1) translate <(xx/2) + (0.104 * (Inc-1)) ,0,0> } object {Tozzetto(Resto-0.004,0.1) translate <((xx/2) - (0.104 * (Inc-1))) - Resto,0,0> } #end #else // CASO 2: centro mattonella a metà segmento #declare Quante = int(((xx/2)-0.052)/0.104); #declare Resto = mod (((xx/2)-0.052),0.104); #declare Inc = 1; #while (Inc <= Quante) object { Tozzetto(0.1,0.1) Cambia() translate <((xx/2) + 0.052) + 0.104*(Inc-1) ,0,0> } object { Tozzetto(0.1,0.1) Cambia() translate <((xx/2) - 0.156) - 0.104*(Inc-1) ,0,0> } #declare Inc=Inc+1; #end #if (Resto != 0) object {Tozzetto(0.1,0.1) Cambia() translate <((xx/2) - 0.052),0,0> } object {Tozzetto(Resto-0.004,0.1) translate <((xx/2) + 0.052) + 0.104*(Inc-1) ,0,0> } object {Tozzetto(Resto-0.004,0.1) translate <((xx/2) - 0.156 + (0.104 - Resto) ) - 0.104*(Inc-1) ,0,0> } #end #end #else #declare Inc = 1; #while ((Inc*0.104) < yy) object {Tozzetto(0.1,0.1) Cambia() translate y*0.104*(Inc-1) } #declare Inc=Inc+1; #end #if (Inc*0.104 = yy) #else object {Tozzetto(0.1,yy-((Inc*0.104)-0.100)) translate y*0.104*(Inc-1)} #end #end #end #macro Mezza_fila (xx,yy) #if( mod ((xx/2),0.104) >= mod ((xx/2)-0.052,0.104)) // CASO 1: spigolo mattonella a metà segmento #declare Quante = int((xx/2)/0.104); #declare Resto = mod ((xx/2),0.104); #declare Inc = 1; #while (Inc <= Quante) object { Tozzetto(0.1,yy) translate <(xx/2) + (0.104 * (Inc-1)) ,0,0> } object { Tozzetto(0.1,yy) translate <(xx/2) - (0.104 * (Inc-1)) - 0.104 ,0,0> } #declare Inc=Inc+1; #end #if (Resto != 0) object {Tozzetto(Resto-0.004,yy) translate <(xx/2) + (0.104 * (Inc-1)) ,0,0> } object {Tozzetto(Resto-0.004,yy) translate <((xx/2) - (0.104 * (Inc-1))) - Resto,0,0> } #end #else // CASO 2: centro mattonella a metà segmento #declare Quante = int(((xx/2)-0.052)/0.104); #declare Resto = mod (((xx/2)-0.052),0.104); #declare Inc = 1; #while (Inc <= Quante) object { Tozzetto(0.1,yy) translate <((xx/2) + 0.052) + 0.104*(Inc-1) ,0,0> } object { Tozzetto(0.1,yy) translate <((xx/2) - 0.156) - 0.104*(Inc-1) ,0,0> } #declare Inc=Inc+1; #end #if (Resto != 0) object {Tozzetto(0.1,yy) translate <((xx/2) - 0.052),0,0> } object {Tozzetto(Resto-0.004,yy) translate <((xx/2) + 0.052) + 0.104*(Inc-1) ,0,0> } object {Tozzetto(Resto-0.004,yy) translate <((xx/2) - 0.156 + (0.104 - Resto) ) - 0.104*(Inc-1) ,0,0> } #end #end #end #macro Cornice (larg,alt) object { union { box{<0,0,-0.008>,<0.02,alt,0.022> texture{Legno_V}} box{, texture{Legno_V}} box{<0.02,0,-0.008>, texture{Legno_O}} box{<0.02,alt-0.02,-0.008>, texture{Legno_O}} } } #end