// Vitor Salvucci Ricci // RA 083052 // Tarefa 03 : Painel de controle // ====================================================================== // DESCRICAO DA CENA // Base do painel #declare base = box{ < 0,0,0 >, <100,50,3> } // Chave #declare chave = union{ box{ < 0,0,0 >, <6,3,1> } box{ < 0,0,0 >, <2,3,1> translate<2,0,0.8> } } // Botao #declare botao = cylinder{ <0,0,0>, <0,0,1> , 3} // Macro responsavel por criar o painel // 'k' corresponde a dimensao do painel #macro painel(k) union{ object{ box{ < 0,0,0 >, <10*(k-1),35,3> } texture{ pigment {color rgb<0,0,0>} } } #declare i=0; #while(i<=k) object{ chave texture{ pigment {color rgb<0.5,0.5,0.5>} } translate<(2+8*i),0,3> } object{ botao #if (mod(i-1,3)=0) texture{ pigment {color rgb<1,0,0>} } #else texture{ pigment {color rgb<0,1,0>} } #end translate<(6+8*i),10,3> } object{ chave texture{ pigment {color rgb<0.5,0.5,0.5>} } rotate<0,0,90> translate<(5+8*i),16,3> } object{ chave texture{ pigment {color rgb<0.5,0.5,0.5>} } rotate<0,0,90> translate<(9+8*i),16,3> } object{ botao #if (mod(i,3)=0) texture{ pigment {color rgb<1,0,0>} } #else texture{ pigment {color rgb<0,1,0>} } #end translate<(6+8*i),28,3> } #declare i = i + 1; #end } #end // Construcao do painel background{ color rgb < 0.75, 0.80, 0.85 > } object{ painel(10) } #include "camlight.inc" #declare centro_cena = < 30.00, 60.00, 5.00 >; #declare raio_cena = 75.0; #declare dir_camera = < 4.00, -10.00, 4.00 >; #declare dist_camera = 400.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)