#include "colors.inc" #include "woods.inc" #include "metals.inc" #include "textures.inc" /*camera{ orthographic location <90,50,100> look_at <0,0,0> angle 95 translate 54*x } background{color White} light_source{<50,100,100> color White} */ // Tous les éléments de la fenêtre ont été créés avec les objets CSG // Création d'un gond // Un gond est créé en ajoutant deux sphères à chaque extrémité d'un cylindre // Le torus permet de séparer le cylindre en deux #declare gond= difference{ union{ cylinder {<55,2,2> <55,-2,2> 1 texture{T_Chrome_2A}} sphere {<55,-2,2> 1 texture{T_Chrome_2A}} sphere {<55,2,2> 1 texture{T_Chrome_2A}} } torus {1,0.1 translate 55*x translate 2*z} } // Création du support de la fenêtre #declare encadrement= union{ difference{ box {<60,60,2> <-60,-60,-2> pigment {color White}/*texture {Rosewood}*/} box {<50,50,3> <-50,-50,-3> texture {Rosewood}} } object {gond} object {gond translate -110*x} object {gond translate 35*y} object {gond translate -35*y} object {gond translate 35*y translate -110*x} object {gond translate -35*y translate -110*x} } // Vitre #declare vitre= box {<50,39,2.5> <4,-39,2> pigment{color White transmit 1} finish{diffuse 0.6 ambient 0.4 reflection 0.1 phong 1}} // Création des carreaux // Les cylindres et les sphères permettent de séparer la fenêtre en carreaux #declare montant= union{ // Carreaux intérieurs cylinder {<47,47,2>, <7,47,2> 1.5} cylinder {<47,47,2>, <47,-47,2> 1.5} cylinder {<47,-47,2>, <7,-47,2> 1.5} cylinder {<7,47,2>, <7,-47,2> 1.5} cylinder {<27,47,2>, <27,-47,2> 1.5} cylinder {<47,15.7,2>, <7,15.7,2> 1.5} cylinder {<47,-15.7,2>, <7,-15.7,2> 1.5} sphere {<47,47,2> 1.5} sphere {<7,47,2> 1.5} sphere {<47,-47,2> 1.5} sphere {<7,-47,2> 1.5} // Carreaux Extérieurs cylinder {<47,47,1.5>, <7,47,1.5> 1.5 texture {Rosewood}} cylinder {<47,47,1.5>, <47,-47,1.5> 1.5 texture {Rosewood}} cylinder {<47,-47,1.5>, <7,-47,1.5> 1.5 texture {Rosewood}} cylinder {<7,47,1.5>, <7,-47,2> 1.5 texture {Rosewood}} cylinder {<27,47,1.5>, <27,-47,1.5> 1.5 texture {Rosewood}} cylinder {<47,15.7,1.5>, <7,15.7,1.5> 1.5 texture {Rosewood}} cylinder {<47,-15.7,1.5>, <7,-15.7,1.5> 1.5 texture {Rosewood}} pigment{color White} } // Création d'une vis pour permettre de fixer la poignée #declare vis= difference { sphere {<1,4,4.5>,0.75 } box{<1.05,5,4.1> <0.95,3,5.5> } } // Création de la poignée #declare poignee= union { box {<2.5,5,4> <-0.5,-5,5> texture{T_Chrome_2B}} cone{<1,0,5>, 1.5, <1,0,9>, 1 texture{T_Chrome_2B}} cylinder {<0,3,9> <2,-3,9> 1 texture{T_Chrome_1A}} sphere {<2,-3,9> 1 texture{T_Chrome_2B}} sphere {<0,3,9> 1 texture{T_Chrome_2B}} object {vis texture{T_Chrome_1A}} object {vis translate -8*y texture{T_Chrome_1A}} } // Côté de la fenêtre qui est ouverte et sur lequel se trouve la poignée #declare fenetre1= union{ difference{ union{ box{<50,50,2> <0,-50,-1> texture {Rosewood}} box{<54,55,2> <0,-55,3> pigment{color White}} } box{<47,47,5> <7,-47,-5> pigment{color White}} } box {<5,55,3> <-3,-55,4> pigment{color White}} object{vitre} object{montant} object{poignee} } // Côté de la fenêtre fermée #declare fenetre2= union{ difference{ union{ box{<0,50,2> <-50,-50,-2> texture {Rosewood}} box{<0,55,2> <-54,-55,3> pigment{color White}} } box{<-7,47,5> <-47,-47,-5> pigment{color White}} } object{vitre translate -54*x} object{montant translate -54*x} } // Assemblage de la fenêtre #declare fenetre= union{ object{encadrement translate -54*x} object{fenetre1 translate -57*x rotate 60*y } object{fenetre2 translate -54*x} } //object {fenetre}