// ====================================================================== // 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 "retalho.inc" #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() } #include "camlight.inc" #declare centro_cena = < 0, 0, 3.00 >; #declare raio_cena = 20.0; #declare dist_camera = 5*raio_cena; #local dir_sol = direcao_do_sol(lat, lon, mes, hora); #local dir_camera = dir_sol; #local dist_camera = 200*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)