// ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_branco = texture{ pigment{ color rgb < 1, 1, 1 > } } #declare tx_fosca_marrom = texture{ pigment{ color rgb < 0.361, 0.2, 0.09 > } } #declare tx_olhos = texture{ pigment{ color rgb < 0.10, 0.62, 0.10 >} finish{ diffuse 0.9 ambient 0.5 } } #declare tamanho_corpo = 20; #declare tamanho_cabeca = 10; // ====================================================================== // DESCRIÇÃO DA CENA // Partes da cena: //Inteiro #macro coelho (ang_bracoD, ang_antebracoD, ang_coxaD, ang_canelaD, ang_peD, ang_bracoE, ang_antebracoE, ang_coxaE, ang_canelaE, ang_peE ,viraCabeca) union { object {cabeca() rotate <0,0,viraCabeca> translate <0,0,tamanho_corpo+tamanho_cabeca-2>} object {corpo()} object {braco(ang_antebracoE) rotate translate <-tamanho_corpo,0,5>} object {braco(ang_antebracoD) rotate translate } object {perna(ang_canelaD, ang_peD) rotate translate <5, 0, -tamanho_corpo+5>} object {perna(ang_canelaE, ang_peE) rotate translate <-5, 0, -tamanho_corpo+5>} } #end //Partes macro #macro cabeca () union{ object { sphere{ <0,0,0>, tamanho_cabeca texture{tx_branco} } } object { sphere{ <0.4*tamanho_cabeca,0.5*tamanho_cabeca,0.4*tamanho_cabeca>, 3 texture{tx_olhos} } } object { sphere{ <-0.4*tamanho_cabeca,0.5*tamanho_cabeca,0.4*tamanho_cabeca>, 3 texture{tx_olhos} } } object { sphere{ <0,0,tamanho_cabeca/2>, 5 texture{tx_branco} } scale <1,0.3,2> rotate <0,7,0> translate <4,0,0>} object { sphere{ <0,0,tamanho_cabeca/2>, 5 texture{tx_branco} } scale <1,0.3,2> rotate <0,-7,0> translate <-4,0,0>} object { box { <-1,-0.3,-2>, <1,0.3,2> texture{tx_branco}} rotate <15,0,0> translate <0.2*tamanho_cabeca,0.9*tamanho_cabeca,-0.4*tamanho_cabeca> } object { box { <-1,-0.3,-2>, <1,0.3,2> texture{tx_branco}} rotate <15,0,0> translate <-0.2*tamanho_cabeca,0.9*tamanho_cabeca,-0.4*tamanho_cabeca> } } #end #macro corpo () union{ object { sphere{ <0,0,0>, tamanho_corpo texture{tx_branco}} } object { sphere{ <0,-0.9*tamanho_corpo,-0.7*tamanho_corpo>, 6 texture{tx_branco}} } } #end #macro braco (ang_antebraco) union { object {sphere{ <0,0,0>, 3 texture{tx_branco}} } object {ombro()} object {antebraco() rotate translate <0,10,0>} } #end #macro perna (ang_canela, ang_pe) union { object {coxa()} object {canela(ang_pe) rotate translate <0,0,-10>} } #end //partes micro #macro ombro () union { object {cylinder {<0,0,0>, <0,10,0>, 3 texture{tx_branco}}} object {sphere{ <0,10,0>, 3 texture{tx_branco}} } } #end #macro antebraco () union { object {cylinder {<0,0,0>, <0,10,0>, 3 texture{tx_branco}}} object {sphere{ <0,10,0>, 4 texture{tx_branco}} } } #end #macro coxa () union { object {cylinder {<0,0,0>, <0,0,-10>, 3 texture{tx_branco}}} object {sphere{ <0,0,-10>, 3 texture{tx_branco}} } } #end #macro canela (ang_pe) union { object {cylinder {<0,0,0>, <0,0,-10>, 3 texture{tx_branco}}} object {cylinder {<0,0,-3>, <0,0,-10>, 4 texture{tx_fosca_marrom}}} object {pe() translate <0,4,0> rotate translate <0,0,-9.9>} } #end //partes nano #macro pe () union{ object {sphere{ <0,-4,0>, 4 texture{tx_fosca_marrom}} } object {box {<-4,-8,-4>, <4,8,2> texture{tx_fosca_marrom}} } } #end #include "eixos.inc" // Aqui está a cena, finalmente: union { object {coelho(30,30,60,0,-30,-45,30,0,0,0,90) translate <30,0,0>} object {coelho(80,10,0,-35,30,0,0,60,-35,-30,-120) rotate <0,0,90> translate <-30,0,0> } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 100.0; #declare dir_camera = < -1.00, 1.00, 0.00 >; #declare dist_camera = 160.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)