// doublage et baies #macro doublage() object { difference { box { <-2.80,-2.10,-2.80>, < 2.80, 2.70, 2.80> } box { <-2.70,-3.01,-2.70>, < 2.70, 3.01, 2.70> } box { <-3.01,-3.01,-3.01>, <-0.90, 0.00, 3.01> } box { <-3.01,-0.01,-2.70>, <-2.69, 1.20, 2.70> } box { < 2.69, 0.00, 0.00>, < 3.01, 3.01,-0.90> } } texture { pigment { /*marble color_map { [ 0.0 color rgb <1,0,0> ] [ 0.1 color rgb <1.0,0.9,0.8> ] } scale 1/4*12/10 rotate <0,0,90> color rgb <0.9,0.9,0.7>*/ granite color_map { [ 0.0 color rgb <0.75,0.28> ] [ 1 color rgb <0.9,0.30> ] } turbulence 0.5 scale 1/2 } finish { ambient 0.2 diffuse 0.6 specular 0.0 brilliance 1 } } } #end #macro baie ( largeur, hauteur, epaisseur, position) union { object { difference { box { <0,0,0>, } box { <0.025,-0.001,0.025>, } } /*texture { pigment { {color rgb 0.8} finish { ambient 0.3 diffuse 0.7 specular 0.7 roughness 0.01 } }*/ /*texture { bumps texture_map { [0.0 pigment { granite color_map { [ 0.0 rgb <0.89, 0.51, 0.28>] [ 0.4 rgb <0.7, 0.13, 0.0> ] [ 0.5 rgb <0.69, 0.41, 0.08>] [ 0.6 rgb <0.49, 0.31, 0.28>] [ 1.0 rgb <0.89, 0.51, 0.28>] }} finish { ambient 0.2 diffuse 0.4 crand 0.2 } ] [0.3 pigment { color rgb <0.66, 0.66, 0.66>} normal { bumps , 0.16 scale 2.0 } finish { ambient 0.3 diffuse 0.7 brilliance 8.0 specular 0.8 roughness 0.1 reflection 0.15 } ] [1.0 pigment { color rgb <0.66, 0.66, 0.66> } normal { bumps , 0.16 scale 2.0 } finish { ambient 0.3 diffuse 0.7 brilliance 8.0 specular 0.8 roughness 0.1 reflection 0.15 } ] } }*/ texture { pigment { color rgb <0.66, 0.66, 0.66> } normal { bumps , 0.16 scale 2.0 } finish { ambient 0.3 diffuse 0.7 brilliance 8.0 specular 0.8 roughness 0.1 reflection 0.15 } } texture { pigment { gradient y color_map { [ 0.0 rgbft <1,1,1> ] [ 0.5 rgbft <0,0,0> ] [ 0.5 rgbft <0.49, 0.31, 0.28, 0.0, 1> ] [ 1.0 rgbft <0.49, 0.31, 0.28, 0.0, 1> ] } turbulence 0.2 scale 20 translate -15*y} normal { bumps , 0.16 scale 2.0 } } } object { box { <0.025,0.020,0.025>, } texture { pigment {color rgbt <0,0,0,0.9>} finish { ambient 0.3 diffuse 0.5 specular 0.7 roughness 0.001 reflection 0.1 refraction 1 } } photons { refraction 1} interior { ior 1 caustics 0.5} } rotate <-90,-90,0> scale <-0.99,1,0.99> translate ( position ) } #end #macro multi_baies (a,b,c) union { object { union { baie (0.90,0.90,0.1,<-0.9 + 0.0, 0.0 - 0.45, 0>) baie (0.90,0.30,0.1,<-0.9 + 0.0, 0.9 - 0.45, 0>) } translate } } #end #macro baie_simple (a,b,c) union { object { union { baie (0.90,0.90,0.1,<-0.9 + 0.0, 0.0 - 0.45, 0>) } translate } } #end #macro baie_simple_2 (a,b,c) union { object { union { baie (0.90,0.95,0.1,<-0.9 + 0.0, 0.0 - 0.45, 0>) } translate } } #end #macro multi_baie_simple_1 (c) union { object { union { baie_simple_2 (-1.9,0.3,-0) multi_baies (-1.9,1.05,-0) } translate (<0,0,-3.7+c*0.90>) } } #end #macro multi_baie_1 (c) union { object { union { baie_simple_2(-1.8,0.25,0.1) multi_baies (-1.8,1,0.1) multi_baies (-1.8,2,0.1) } translate (<0,0,-3.7+c*0.90>) } } #end #macro baies_laterales() object { union { multi_baie_simple_1 (1) multi_baie_simple_1 (0) } translate <0.1,-0.05,1> rotate <0,90,0> } object { union { multi_baie_simple_1 (1) multi_baie_simple_1 (0) } translate <5.60,-0.05,1> rotate <0,90,0> } #end #macro baie_toit (a,b) union { object { union { baie (0.90,0.90,0.1,<-0.9 + 0.0, 0.0 - 0.45, 0>) } translate < 3.6,-2.25+a*0.9,-2.7+b*0.9> rotate <0,0,90> } } #end #macro store (angle_stores,hauteur) object { box { <-0,-0,-0>, < 0.03, hauteur, 0.8> } texture { pigment { gradient y color_map { [ 0.0 color rgbt <0.5,0.5,0.5,0.0> ] [ 0.3 color rgbt <0.5,0.5,0.5,1> ] } scale 1/32 rotate <0,0,angle_stores> } finish { ambient 0.9 diffuse 0.9 specular 0.0 } } } #end #macro mur_store(angle_stores) object {store (angle_stores,3.30) translate <-2.60,-2.10, 1.850>} object {store (angle_stores,3.30) translate <-2.60,-2.10, 0.950>} object {store (angle_stores,1.50) translate <-2.60,-0.30, 0.050>} object {store (angle_stores,1.50) translate <-2.60,-0.30,-0.850>} object {store (angle_stores,3.30) translate <-2.60,-2.10,-1.750>} object {store (angle_stores,3.30) translate <-2.60,-2.10,-2.650>} object {store (angle_stores,2.10) translate <-2.70,-2.10,-1.70> rotate <0,90,0>} object {store (angle_stores,2.10) translate <-2.70,-2.10,-2.60> rotate <0,90,0>} object {store (angle_stores,2.10) translate < 2.65,-2.10,-1.70> rotate <0,90,0>} object {store (angle_stores,2.10) translate < 2.65,-2.10,-2.60> rotate <0,90,0>} #end #macro porte_fenetre (a,b,c) union { object { union { baie (0.90,2.10,0.1,<-0.9 + 0.0, 0.0 - 0.45, 0>) baie (0.90,0.30,0.1,<-0.9 + 0.0, 1.35, 0>) } translate rotate <0,0,0> } } #end #macro multi_baie_1_porte_fermee (c) union { object { union { porte_fenetre (-1.8,0.25,0.1) multi_baies (-1.8,2,0.1) } translate (<0,0,-3.7+c*0.90>) } } #end #macro petite_baie_porte_ouverte (c) union { object { union { multi_baies (-1.8,2,0.1) } translate (<0,0,-3.7+c*0.90>) } } #end #macro porte_fenetre_ouverte_gauche (angles) union { object { union { baie (0.90,2.10,0.1,<0 , 0, 0>) baie (0.90,0.30,0.1,<0 ,1.80, 0>) } translate <0,0,0> translate <0,0,-0.90> #if (angles >180) #local angles = 180; #end #if (angles <0) #local angles = 0; #end rotate <0,angles, 0> translate <0,0,0.9> translate <-2.73,-2.1,-0.08> } } #end #macro porte_fenetre_ouverte_droite (angles) union { object { union { baie (0.90,2.10,0.1,<0 , 0, 0>) baie (0.90,0.30,0.1,<0 ,1.80, 0>) } #if (angles >180) #local angles = 180; #end #if (angles <0) #local angles = 0; #end rotate <0,-angles, 0> translate <-2.73,-2.1,-0.85> } } #end #macro spot( position, cible, cone_lumiere, taille_spot, couleur ) light_source { position // position de la source lumineuse color rgbt <1,1,1,1> // couleur emise par la source lumineuse spotlight // type de source lumineuse point_at cible // direction du spot radius cone_lumiere // angle interieur du cone lumineux tightness 0 // intensitŽ du faisceau 0 ˆ 100 falloff cone_lumiere // angle exterieur du cone lumineux looks_like { sphere { 0, taille_spot } texture { pigment { color rgb couleur } finish { ambient 1 } } } } #end #macro test_spots( N ) #local i=0; #while (i, , 20, 0.05, ) #local i=i+1; #end #end #macro quatre_spots() object { spot( <-30,400, -300>, <0, 0, -6>, 20, 0.00, <1,1,1,1> ) rotate <0,0,0> } object { spot( <4, 0.2, -10>, <0, 0, 6>, 20, 0.00, <1,1,1,1> ) rotate <0,0,-180> } object { spot( <0, 1, -1.50>, <0, 0, 6>, 40, 0.00, <1,1,1> ) rotate <90,0,0> } #end #macro baies_fini (angle_portes, avec_stores,angle_stores, avec_spot) // les baies en toiture baie_toit (0,0) baie_toit (1,0) baie_toit (0,1) baie_toit (1,1) baie_toit (0,2) baie_toit (1,2) baie_toit (0,3) baie_toit (1,3) baie_toit (0,4) baie_toit (1,4) baie_toit (0,5) baie_toit (1,5) union { object { union { baie (0.90,2.9.1,<-0.9 + 0.0, 0.0 - 0.45, 0>) baie (0.90,0.3,0.1,<-0.9 + 0.0,2.4, 0>) } } translate <-1.8,0,0> rotate <0,180,0> } // la façade multi_baie_1 (1) multi_baie_1 (2) //multi_baie_1_porte_fermee(3) //multi_baie_1_porte_fermee(4) multi_baie_1 (5) multi_baie_1 (6) baies_laterales () porte_fenetre_ouverte_droite (angle_portes) porte_fenetre_ouverte_gauche (angle_portes) petite_baie_porte_ouverte (3) petite_baie_porte_ouverte (4) //les stores #if ( avec_stores ) mur_store (angle_stores) #end // Lumière #if ( avec_spot ) test_spots(1) quatre_spots() #end #end