// ====================================================================== // CÂMERA camera{ location < 14.00, 8.00, 4.50 > // Posição do observador. right -0.60*x // Largura RELATIVA da imagem. up 0.60*y // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < 0.00, 1.00, 2.00 > // Para onde a câmera está apontando. } // Nota: os parâmetros "right" e "up" devem ter a mesma proporção // que os parâmetros ${WIDTH} e ${HEIGHT} no Makefile. // ====================================================================== // FONTES DE LUZ light_source{ 10 * < +50.0, +30.0, +50.0 > // Posição da lâmpada. color rgb 1.0 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source{ 10 * < +50.0, -10.0, +10.0 > // Posição da lâmpada. color rgb 0.5 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // EIXOS DE COORDENADAS #macro eixo(ponta,cor,nome) union{ sphere{ <0,0,0>, 0.02 } cylinder{ <0,0,0>, 0.91*ponta, 0.02 } cone{ 0.90*ponta, 0.06, ponta, 0.00 } texture{ pigment{ color rgb cor } finish{ ambient 0.5 diffuse 0.5 } } } #end #macro eixos(tamanho) union{ object{ eixo( , <1.0,0.2,0.2>, "X") } object{ eixo( <0,tamanho,0>, <0.0,0.8,0.0>, "Y") } object{ eixo( <0,0,tamanho>, <0.3,0.3,1.0>, "Z") } } #end // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_galinha = texture{ pigment{ color rgb < 1.00, 0.9, 0.8 > } finish{ diffuse 0.6 ambient 0.2 } } // ====================================================================== // DESCRIÇÃO DA CENA // Partes da cena: #macro pe() box{ <0,0,0>, <1,0.5,0.2> texture{ tx_galinha } } #end #macro canela_com_pe( beta ) union{ cylinder{ <0,0,0>, <1.5,0,0>, 0.3 texture{ tx_galinha } } sphere{ <1.5,0,0> 0.3 texture{ tx_galinha } } object{ pe() rotate beta*y translate <1.5,-0.2,0> } } #end #macro perna( alfa, beta ) union{ cylinder{ <0,0,0>, <2,0,0>, 0.3 texture{ tx_galinha } } sphere{ <2,0,0> 0.3 texture{ tx_galinha } } object{ canela_com_pe(beta) rotate -alfa*y translate <2,0,0> } } #end #macro bico() cone{ <0,0,0> 0.5 <1,0,0> 0 scale 0.8*z texture{ tx_galinha } } #end #macro cabeca() union{ sphere{ <0,0,0> 1 texture{ tx_galinha} } object{ bico() translate <0.9,0,0> } } #end #macro cabeca_pescoco( alfa, beta) union{ cylinder{ <0,0,0>, <1.5,0,0>, 0.2 texture{ tx_galinha } } object{ cabeca() scale 0.4 rotate alfa*z rotate beta*y translate <1.5,0,0> } } #end #macro ponta_asa() cone{ <0,0,0> 0.18 <1.5,0,0> 0 texture{ tx_galinha } } #end #macro asa( alfa, beta ) union{ cylinder{ <0,0,0>, <0.6,0,0>, 0.18 texture{ tx_galinha } } sphere{ <0,0,0> 0.18 translate <0.6,0,0> texture{ tx_galinha} } object{ ponta_asa() rotate alfa*y rotate beta*y translate <0.6,0,0> } } #end #macro corpo( alfa, alfa_cp, beta_cp, pa1, pb1, pc1, pa2, pb2, pc2, pa3, pb3, pc3, pa4, pb4, pc4, pa5, pb5, pc5, pa6, pb6, pc6, alfa_asa1, inc_asa1, alfa_asa2, inc_asa2 ) union{ sphere{ <0,0,0> 1 scale 1.4*x texture{ tx_galinha} } object{ cabeca_pescoco(alfa_cp,beta_cp) rotate -alfa*y translate <1,0,0.3> } // pernas sphere{ <0,0,0> 0.3 scale 0.6 translate <1,0.5,-0.35> texture{ tx_galinha} } object{ perna(pa1,pb1) scale 0.6 rotate pc1*y translate<1,0.5,-0.35> } sphere{ <0,0,0> 0.3 scale 0.6 translate <0,0.5,-0.35> texture{ tx_galinha} } object{ perna(pa2,pb2) scale 0.6 rotate pc2*y translate<0,0.5,-0.35> } sphere{ <0,0,0> 0.3 scale 0.6 translate <-1,0.5,-0.35> texture{ tx_galinha} } object{ perna(pa3,pb3) scale 0.6 rotate pc3*y translate<-1,0.5,-0.35> } sphere{ <0,0,0> 0.3 scale 0.6 translate <1,0.5,-0.35> texture{ tx_galinha} scale<1,-1,1> } object{ perna(pa4,pb4) scale 0.6 rotate pc4*y translate<1,0.5,-0.35> scale<1,-1,1> } sphere{ <0,0,0> 0.3 scale 0.6 translate <0,0.5,-0.35> texture{ tx_galinha} scale<1,-1,1> } object{ perna(pa5,pb5) scale 0.6 rotate pc5*y translate<0,0.5,-0.35> scale<1,-1,1> } sphere{ <0,0,0> 0.3 scale 0.6 translate <-1,0.5,-0.35> texture{ tx_galinha} scale<1,-1,1> } object{ perna(pa6,pb6) scale 0.6 rotate pc6*y translate<-1,0.5,-0.35> scale<1,-1,1> } // asas sphere{ <0,0,0> 0.18 translate <-0.3,1,0> texture{ tx_galinha} scale <-1,1,-1> } object{ asa(alfa_asa1, inc_asa1) translate <-0.3,1,0> scale <-1,1,-1> } sphere{ <0,0,0> 0.18 translate <-0.3,1,0> texture{ tx_galinha} scale <-1,1,-1> scale <1,-1,1> } object{ asa(alfa_asa2, inc_asa2) translate <-0.3,1,0> scale <-1,1,-1> scale <1,-1,1> } } #end // Cena: object{ eixos(3.00) } object { corpo(20, 30, 50, 40, -80, 90, 60, -60, 90, 40, -60, 90, 40, -60, 100, 50, -60, 90, 40, -60, 90, 30, 10, 50, 20) rotate 13*z translate <0,0,0> } object { corpo(50, 20, 50, 40, -60, 80, 80, -60, 110, 40, -60, 90, 40, -60, 90, 40, -60, 90, 40, -60, 90, 70, 20, 40, 70) rotate -80*z translate <0,4,4> } object { corpo(30, 40, 50, 40, -50, 100, 40, -60, 90, 40, -60, 90, 40, -60, 80, 60, -60, 90, 40, -60, 90, 20, 30, 30, 10) rotate 0*z translate <-4,-5,3> }