//directives #ifndef (Ombres_Douces) # declare Ombres_Douces = false; # declare Super_Ombres = true; #end //textures #declare P_BoisA = pigment{ gradient x rotate -30*y triangle_wave warp { turbulence 0.3 octaves 1 } color_map { [0 color rgb <0.22,0.051,0.024>] [1 color rgb <0.427,0.176,0.027>] } scale 0.1 } #declare P_BoisB = pigment{ gradient x rotate 50*y triangle_wave warp { turbulence 0.3 octaves 1 } color_map { [0 color rgb <0.22,0.051,0.024>] [1 color rgb <0.427,0.176,0.027>] } scale 0.1 } #declare P_Bois =pigment { gradient z scale 3 pigment_map { [0 P_BoisA] [0.5 P_BoisA] [0.5 P_BoisB] [1 P_BoisB] } } #declare T_Verre = texture { pigment { color rgbf<0.98,1,0.98,0.95> } finish { specular 1 ambient 5 diffuse 0 reflection {0.01,0.2} } } #declare T_Verre2 = texture { pigment { color rgbf<0.98,1,0.98,0.95> } finish { specular 0.4 ambient 0 diffuse 0 reflection {0.01,0.1} } } #declare T_PeintureNoire =texture { pigment {color rgb 0.1} finish {reflection {0.05, 0.3} phong 1 conserve_energy } } #declare T_Aluminium = texture { pigment {color rgb <0.94,0.93,0.9>} finish { ambient 0.1 brilliance 6 diffuse 0.7 metallic specular 0.6 roughness 1/120 reflection 0.7 } normal {wrinkles 0.01} } #declare T_Table = texture { pigment {color rgb <0.302,0.184,0.000>} finish {phong 0.2} } //table #declare plateau = difference { superellipsoid {<0.02,0.02> translate <1,1,1> scale <10.5,1,6.5> } // box {<0,0,0>, <21,2,13>} union { cylinder {<-1,1,0>,<22,1,0>, 0.1} cylinder {<0,1,-1>,<0,1,14>,0.1} cylinder {<-1,1,13>,<22,1,13>,0.1} cylinder {<21,1,-1>,<21,1,14>,0.1} } } #declare pied = difference { //pied posé en 0, z de 0 à 2, y de 0 à 13 prism {cubic_spline -2,0, 14 <-1,13.5>, <1,13.5>,<2,10>, <1,4>, <1,3>,<1,3>,<4,1>,<3,0>,<1,0>,<0,1>,<-1,6>,<-1,13.5>,<1,13.5>,<-1,13.5> rotate -90*x } sphere_sweep { cubic_spline 8 <0,14,0>,0.2 <0,13,0>,0.2 <0,7,0>,0.2 <0.4,3,0>,0.2 <1,1,0>,0.2 <1.7,0.9,0>,0.2 <1.5,1.5,0>,0.2 <1,1.5,0>,0.2 } sphere_sweep { cubic_spline 8 <0,14,2>,0.2 <0,13,2>,0.2 <0,7,2>,0.2 <0.4,3,2>,0.2 <1,1,2>,0.2 <1.7,0.9,2>,0.2 <1.5,1.5,2>,0.2 <1,1.5,2>,0.2 } } #declare Table= union { //table, de <0,0,0> à <21,15,13> object {plateau texture {pigment {P_Bois } finish { phong 0.2 phong_size 15 specular 0.15 roughness 0.2 } } translate 13*y } object {pied translate <18,0,1> texture { pigment {P_Bois} rotate 85*z finish { phong 0.2 phong_size 15 specular 0.15 roughness 0.2 } } } object {pied translate <18,0,10> texture {pigment {P_Bois} rotate 90*z finish { phong 0.2 phong_size 15 specular 0.15 roughness 0.2 } } } object {pied rotate <0,180,0> translate <3,0,3> texture {pigment {P_Bois} rotate 88*z finish { phong 0.2 phong_size 15 specular 0.15 roughness 0.2 } } } object {pied rotate <0,180,0> translate <3,0,12> texture {pigment {P_Bois} rotate 92*z finish { phong 0.2 phong_size 15 specular 0.15 roughness 0.2 } } } } //lampe # declare Ecrou = prism { //ecrou standardisé, entre 0 et 1 linear_spline 0,1,7 <0,1>,<0.866,0.5>,<0.866,-0.5>,<0,-1>,<-0.866,-0.5>,<-0.866,0.5>,<0,1> } #declare LampeA = union { union { // texture peinte cone {<0,0,0>,2,<0,3,0>,0 //corps scale <1,1,3.5/4> matrix <1,0,0, -1/3,1,0, 0,0,1, 0,0,0> } difference { box {<-1.2,2,-0.4>,<-0.4,3,0.4>} box {<-1.3,1.9,-0.2>,<-0.3,3.1,0.2>} } cylinder {<-0.8,2.7,-0.35>,<-0.8,2.7,0.35>,0.45} difference { //axe cylinder {<-0.8,2.7,-0.45>,<-0.8,2.7,0.45>,0.3} cylinder {<-0.8,2.7,-0.5>,<-0.8,2.7,0.5>,0.25} } texture {T_PeintureNoire} } union { // texture aluminium cylinder {<-0.8,2.7,-0.47>,<-0.8,2.7,-0.49>,0.24} // rondelles cylinder {<-0.8,2.7,0.47>,<-0.8,2.7,0.49>,0.24} cylinder {<-0.8,2.7,-0.65>,<-0.8,2.7,0.65>,0.1} // vis sphere {<-0.8,2.7,-0.65>,0.1} sphere {<-0.8,2.7,0.65>,0.1} object {Ecrou // ecrou rotate 90*x scale <0.2,0.2,0.03> translate <-0.8,2.7,0.53> } object {Ecrou rotate 90*x scale <0.2,0.2,0.03> translate <-0.8,2.7,-0.53> } texture {T_Aluminium} } } #declare LampeB = union { union { // texture peinte difference { cone {<0,0,0>,1,<0,1.5,0>,0 //corps scale <1,1,3.5/4> matrix <1,0,0, -1/3,1,0, 0,0,1, 0,0,0> } sphere {<0,0,0>,0.95 // trou scale <1,0.2,3.5/4> } } difference { box {<-0.6,1,-0.2>,<-0.2,1.5,0.2>} box {<-0.7,0.9,-0.1>,<-0.1,1.7,0.1>} } cylinder {<-0.4,1.35,-0.175>,<-0.4,1.35,0.175>,0.175} difference { //axe cylinder {<-0.4,1.35,-0.225>,<-0.4,1.35,0.225>,0.3} cylinder {<-0.4,1.35,-0.25>,<-0.4,1.35,0.25>,0.25} } texture {T_PeintureNoire} } union { // texture aluminium cylinder {<-0.4,1.35,-0.235>,<-0.4,1.35,-0.245>,0.24} // rondelles cylinder {<-0.4,1.35,0.235>,<-0.4,1.35,0.245>,0.24} cylinder {<-0.4,1.35,-0.325>,<-0.4,1.35,0.325>,0.1} // vis sphere {<-0.4,1.35,-0.325>,0.1} sphere {<-0.4,1.35,0.325>,0.1} object {Ecrou // ecrou rotate 90*x scale <0.2,0.2,0.03> translate <-0.4,1.35,0.265> } object {Ecrou rotate 90*x scale <0.2,0.2,0.03> translate <-0.4,1.35,-0.265> } texture {T_Aluminium} } cylinder { <0,-0.02,0>,<0,0.02,0>,0.95 texture {T_Verre} interior {ior 1.5} } light_source { <0,0.18,0> color rgb <0.961,1,0.876> spotlight point_at <0,-2,0> radius 45 falloff 60 fade_distance 8 fade_power 2 #if (Ombres_Douces = true) #if (Super_Ombres = true) area_light <0.9,0,0>,<0,0,0.9>,25,25 adaptive 2 #else area_light <0.9,0,0>,<0,0,0.9>,4,4 adaptive 2 #end circular orient jitter #end } } #declare Lampe = union { object{LampeA} object{LampeB rotate <0,0,45> translate <6,4,0> } cylinder {<-0.8,2.7,0>,<4.763,4.7,0>,0.1} } #declare Cadre= union { difference { box{<-0.8,-0.8,0>,<7.2,0,0.5>} prism {linear_spline -0.1,1, 4 <-0.801,-0.801>,<0,0>,<-0.801,0>,<-0.801,-0.801> matrix <1,0,0,0,0,1,0,1,0,0,0,0> //échange y et z } prism {linear_spline -0.1,1, 4 <7.201,-0.801>,<6.4,0>,<7.201,0>,<7.201,-0.801> matrix <1,0,0,0,0,1,0,1,0,0,0,0> //échange y et z } pigment {P_BoisA rotate 90*z} } difference { box{<-0.8,4.8,0>,<7.2,5.6,0.5>} prism {linear_spline -0.1,1, 4 <-0.801,5.601>,<0,4.799>,<-0.801,4.799>,<-0.801,5.601> matrix <1,0,0,0,0,1,0,1,0,0,0,0> //échange y et z } prism {linear_spline -0.1,1, 4 <7.201,5.601>,<6.4,4.799>,<7.201,4.799>,<7.201,5.601> matrix <1,0,0,0,0,1,0,1,0,0,0,0> //échange y et z } pigment {P_BoisA rotate 90*z} } box{<-0.8,-0.8,0.01>,<0,5.6,0.499> pigment {P_BoisB} } box{<6.4,-0.8,0.01>,<7.2,5.6,0.499> pigment {P_BoisB} } box {<-0.01,-0.01,0.2>,<6.401,4.801,0.2> pigment {image_map {jpeg "photo.jpg" }scale <6.4,4.8,1> } } box {<-0.01,-0.01,0.1><6.401,4.801,0.19> texture {T_Verre2} normal {bumps 0.06 scale 0.3} interior {ior 1.5 } } } /*/pour les tests camera { location <14,5,-8> look_at <3,2,0> } light_source { <14,5,-8> color rgb 1 } object {Cadre } // fin de tests */