// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2010-03-04 15:44:01 by stolfi // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.2 roughness 0.005 } } #declare tx_verde = texture{ pigment{ color rgb < 0.48, 0.99, 0.00 > } }; #declare tx_cinza_escuro = texture{ pigment{ color rgb < 0.2, 0.2, 0.2 > } }; #declare tx_vermelho = texture{ pigment{ color rgb < 1.00, 0.00, 0.00 > } } #declare tx_marrom = texture{ pigment{ color rgb < 0.92, 0.64, 0.51 > } }; #declare tx_branco = texture{ pigment{ color rgb < 1, 1, 1 > } }; #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } finish{ diffuse 0.2 reflection 0.2*< 1.00, 0.85, 0.30 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.90, 0.90, 0.90 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRIÇÃO DA CENA #declare M = 5; //Num Quadros #declare valores = array[M] {0,1,2,3,4}; #declare valores2 = array[6] {1,3,5,7,9,11}; #declare roleta = seed(417); // Partes da cena: #declare haste_con = cone{ <0, 0, 0>, 0, <0, 0, 3>, 1 texture{ tx_branco } } #declare haste_esf = sphere{ < 0,0,0 >, 1 texture{ tx_branco } } #declare caixa= box{ <+3,+1.5,0>, <-3,-1.5,-1> texture { tx_branco } } #declare chao = box{ <50, 50, 0>, <-50, -50, 0.5> texture { tx_verde } } #declare haste_cil = cylinder { <0,0,0>, <0,0,1>, 1 } #macro alavanca(rot, defeito) #local textura = tx_branco; #if (defeito = 1) #local textura = tx_verde; #end union{ union{ object { haste_con texture { textura }} difference { object { haste_esf texture { textura }} object { caixa texture { textura }} translate <0,0,3> } translate<0,0,1> rotate -25*rot *y } object { caixa translate<0,0,0.5> texture { tx_plastico }} object { haste_esf scale<0.8,0.8,0.8> translate <0,0,0.7> texture { textura }} difference { object { haste_cil texture { tx_branco }} object { haste_cil scale<0.8,0.8,1.5> translate<0,0,0.2>} } } #end #macro move_alavanca(valor, defeito) #if(valor = 0) alavanca(-1, defeito) #else alavanca(1, defeito) #end #end #macro fileira(n, valor, p) #local i=0; union{ #while (i < n) #if (rand(roleta) <= p) #local defeito = 1; #else #local defeito = 0; #end object { move_alavanca(mod(valor,2), defeito) translate<0, i*-2.5, 0>} #local i = i+1; #local valor = int( valor / 2 ); #end } #end #macro abaco(m,n,valor, prob) #local i=0; union{ #while (i < m) object { fileira(n, valor[i], prob) translate <6*i, 0, 0>} #local i = i+1; #end } #end #include "eixos.inc" #macro letra_chegando(letra, posIni, posFin, frac) object { texto(letra) translate} #end #macro logotipo(meuTexto, fase) #local n = strlen(meuTexto); #local etapa = int(fase*n); #local frac = fase * n - etapa; union { object{ texto( substr(meuTexto, 1, etapa)) } #if (fase < 1) object{ letra_chegando(substr(meuTexto, etapa+1, 1), 3, 0.7*etapa, frac)} #end } #end #macro texto(meuTexto) union { text { ttf "verdana.ttf" meuTexto 1, 0 texture { tx_plastico } } } #end // Aqui está a cena, finalmente: union{ object{ logotipo("GHSO", clock) rotate 90 *z} } #include "camlight.inc" #declare centro_cena = < 0, 1.5, 0.00 >; #declare raio_cena = 3; #declare dir_camera = < 1, 0, 5.00 >; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)