// Trabalho Pratico 2 // Autor: Guilherme Seiji Ito // RA: 146325 // ====================================================================== // CORES E TEXTURAS background{ color rgb < 1, 1, 1 > } #declare tx_pele = texture{ pigment{ color rgb <1,0.8,0.5> } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_roupa_soldado = texture{ pigment{ color rgb <0,0,1> } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_roupa_sargento = texture{ pigment{ color rgb <1,0,0> } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_xadrez_soldado = texture{ pigment{ checker color rgb < 0.20, 1, 0 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } #declare tx_xadrez_sargento = texture{ pigment{ checker color rgb < 0, 0, 0 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRIÇÃO DA CENA #declare cabeca = sphere{<0,0,0>, 1.25 texture{tx_pele}} #declare corpo = box{ <0,0,0>, <1.4,3,5> } #declare pescoco = cone{ <0,0,1>, 0.25 <0,0,0>, 0.7 texture{ tx_pele } } #declare ombros = sphere{ < 0,0,0 >, 0.75 } #declare membros_superior = cylinder{ < 0, 0, 4 >, < 0, 0, 0 >, 0.5 texture {tx_pele} } #declare membros_inferior = cylinder{ < 0, 0, 4 >, < 0, 0, 0 >, 0.7 } #declare chapeu = cone{ <0,0,1>, 0.50 <0,0,0>, 1.5 } #macro soldado(tipo) union { object{cabeca translate <0,0,6.5> } object{pescoco translate <0,0,5>} object{membros_superior translate <0,-2.7,0.6> rotate <-10,0,0>} object{membros_superior translate <0,2.7,0.6> rotate <10,0,0>} #if(tipo) object{corpo translate < -0.7,-1.5,0 > texture {tx_roupa_sargento}} object{ombros translate <0,1.9,4.5> texture {tx_roupa_sargento}} object{ombros translate <0,-1.9,4.5> texture {tx_roupa_sargento}} object{membros_inferior translate <0,0.75,-3.7> rotate <10,0,0> texture {tx_roupa_sargento}} object{membros_inferior translate <0,-0.75,-3.7> rotate <-10,0,0> texture {tx_roupa_sargento}} object{chapeu translate <0,0,7> texture{ tx_xadrez_sargento }} #else object{corpo translate < -0.7,-1.5,0 > texture {tx_roupa_soldado}} object{ombros translate <0,1.9,4.5> texture {tx_roupa_soldado}} object{ombros translate <0,-1.9,4.5> texture {tx_roupa_soldado}} object{membros_inferior translate <0,0.75,-3.7> rotate <10,0,0> texture {tx_roupa_soldado}} object{membros_inferior translate <0,-0.75,-3.7> rotate <-10,0,0> texture {tx_roupa_soldado}} object{chapeu translate <0,0,7> texture{ tx_xadrez_soldado }} #end } #end #macro pelotao(l, c) union { #declare i=0; #while(i} #else object{soldado(0) translate} #end #declare j=j+1; #end #declare i=i+1; #end } #end #include "eixos.inc" // Aqui está a cena, finalmente: union{ object{ eixos(3.00) } object{pelotao(9, 9)} } #include "camlight.inc" #declare centro_cena = < 0.00, 25.00, 1.00 >; #declare raio_cena = 50.0; #declare dir_camera = < 14.00, 0.00, 8.00 >; #declare dist_camera = 150.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)