// Last edited on 2023-12-30 00:43:03 by stolfi #version 3.7; global_settings { assumed_gamma 2.2 } // ====================================================================== // MC937A/MO603A – Computacao Grafica - 2023-S2 // Trabalho de laboratorio 10 - 2023-12-06 // Templo do Sol // // RA108231 - Oscar dos Santos Esgalha Neto // ====================================================================== background{ color rgb < 0.7, 0.7, 0.9 > } #include "direcao_do_sol.inc" #include "parametros.inc" #declare textura = texture{ pigment{ color rgb < 0.39, 0.29, 0.25 > } finish{ diffuse 0.8 ambient 0.1 } } #macro painel_solar() object { box { <0, 0, 0>, <0.1, 1, 2> texture { pigment { color rgb <1, 0, 0> } finish { ambient 1 diffuse 0 } } } } #end #macro parede() union { object { box { <0, 0, 0>, <1, 6, 4> texture { textura } } } object { painel_solar() translate <-0.1, 0.5, 0.5> } object { painel_solar() translate <-0.1, 4.5, 0.5> } } #end #macro porta() object { cone { <0, 0, 0>, 1 <0, 0, 3>, 1 texture { textura } } } #end #macro andar() union { object { parede() rotate y*15 translate <0, 0, 0> } object { parede() rotate y*15 rotate z*90 translate <7, -1, 0> } object { parede() rotate y*15 rotate z*-90 translate <1, 7, 0> } object { parede() rotate y*15 rotate z*180 translate <8, 6, 0> } } #end #macro primeiro_andar() difference { object { andar() scale <1.5, 1.5, 1> } object { porta() rotate y*90 translate <0, 4.5, 1> } } #end #macro segundo_andar() union { object { andar() scale <1, 1, 1> translate <2, 1.5, 4> } } #end #macro pilar() object { box { <0, 0, 0>, <1, 1, 4> texture { textura } } } #end #macro teto() object { union { pilar() object { pilar() translate <4, 0, 0> } object { pilar() translate <0, 4, 0> } object { pilar() translate <4, 4, 0> } difference { object { box { <0, 0, 0>, <5, 5, 0.5> texture { textura } } translate <0, 0, 4> } object { cone { <1.5, 1.5, 0>, 1 <1.5, 1.5, 3>, 1 texture { textura } } translate <1, 1, 3> } } } translate <3.5, 2, 7> } #end #macro templo() union { primeiro_andar() segundo_andar() teto() } #end object { templo() } #local dir_norte = < 0.0, cos(radians(lat)), sin(radians(lat)) >; #local dir_sol = direcao_do_sol(lat, lon, mes, hora); #include "eixos.inc" #local cmp_eixos = 8.0; // object{ eixos(cmp_eixos) } #declare cmin = < -1.0, -2.5, -0.1 >; #declare cmax = < +13.0, +11.5, +12.0 >; #declare centro_cena = (cmin + cmax)/2; #include "gaiola.inc" // object{ gaiola(cmin,cmax) } object{ gaichao(cmin,cmax) } #include "camsol.inc" #declare raio_cena = 0.65*vlength(cmax-cmin); #declare intens_luz = 1.20; camsol(centro_cena, raio_cena, vista, dir_norte, dir_sol, intens_luz)