// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2003-07-31 12:50:37 by stolfi #include "colors.inc" // ====================================================================== // CÂMERA camera { location < 20.00, 15.00, 30.00 > // Posição do observador. right -1*x //< -0.60, 0.00, 0.00 > // Largura RELATIVA da imagem. up 0.75*y //< 0.00, 0.80, 0.00 > // Altura RELATIVA da imagem. sky < 0.00, 1.00, 0.00 > // Qual direção é "para cima"? look_at < 5.00, 0.00, 0.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.2 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { 10 * < +50.0, 20.0, +10.0 > // Posição da lâmpada. color rgb 0.8 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // DESCRIÇÃO DA CENA background{ color rgb < 0.75, 0.80, 0.85 > } #declare raio = 2.000; #declare clock0 = clock; #declare clock1 = mod(clock+0.5,1); #declare cor_cristal = <1.00, 0.0, 0.0>; #declare tx_cristal= texture{ finish{ ambient 0.1 diffuse 0.1 reflection 0.25 specular 1 roughness 0.001 } pigment { color cor_cristal filter 1} } #declare cor_cristal2 = <0.10, 0.90, 1.00>; #declare tx_cristal2= texture{ finish{ ambient 0.1 diffuse 0.1 reflection 0.25 specular 1 roughness 0.001 } pigment { color cor_cristal2 filter 1} } #declare cor_espelho = <1.00, 0.80, 0.10>; #declare tx_espelho = texture{ pigment{ rgb cor_espelho } finish{ ambient 0.05 diffuse 0.05 reflection cor_espelho specular 0.20 roughness 0.05 } } #declare cor_espelho2 = <0.10, 0.80, 1.00>; #declare tx_espelho2 = texture{ pigment{ rgb cor_espelho2 } finish{ ambient 0.05 diffuse 0.05 reflection cor_espelho2 specular 0.20 roughness 0.05 } } #declare tinta_A = texture { pigment { color rgb < 0.10, 0.80, 1.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare tinta_B = texture { pigment { color rgb < 1.00, 0.80, 0.10 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare vermelho = texture { pigment { color rgb < 1.00, 0.00, 0.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare verde = texture { pigment { color rgb < 0.00, 1.00, 0.00 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare s_pos1 = seed(2355); #declare s_pos2 = seed(34235); #declare s_pos3 = seed(5464554); #declare s_pos1b = seed(67867); #declare s_pos2b = seed(2135); #declare s_pos3b = seed(21435); sphere { < -6, 0.00, 0>, 3.0 texture { vermelho } scale <1,0.6,0.5> } difference{ sphere { < 6*3, 0.00, 0>, 3.0 texture { vermelho } scale <1,0.6,0.5> } sphere { < 21, 0.00, 0>, 3.0 texture { vermelho } scale <1,1,0.3> } } #declare i = 0; #while (i<3) #declare j = 0; #declare h = 1; #declare posx = i*6; sphere { < posx, 0.00, 0>, 3.0 texture { verde } scale <1,0.6,0.5> } #while (j<4) #declare pos1 = rand(s_pos1); #declare pos2 = rand(s_pos2); #declare pos3 = rand(s_pos3); #declare pos4 = rand(s_pos1b); #declare pos1b = rand(s_pos2b); #declare pos3b = rand(s_pos3b); #declare bola = sphere { <0,0,0> 0.5 texture {vermelho} } #declare parte4 = union{ cylinder { < 0.00, 0.00, 0.00 >, < 2.00, 0.00, 0.00 >, 0.5 texture { tx_espelho } } object { bola } } #declare ang3 = -70-30*pos3; #declare parte3 = union{ cylinder { < 0.00, 0.00,0.00 >, < 2.50, 0.00, 0.00 >, 0.5 texture { tx_espelho2 } } object { parte4 rotate ang3*y translate <2.5,0,0> } object { bola translate <2.5,0,0> } } #declare ang2 = 10+30*pos2; #declare parte2 = union{ cylinder { < 0.00, 0.00, 0.00 >, < 3.00, 0.00, 0.00 >, 0.5 texture { tx_espelho } } object { parte3 rotate ang2*y translate <3,0,0> } object { bola translate <3,0,0> } } #declare ang1 = 80+20*pos1; #declare parte1 = union{ cylinder { < 0.00, 0.00, 0.00 >, < 3.00, 0.00, 0.00 >, 0.5 texture { tx_espelho2 } } object {parte2 rotate 90*y #if(mod(i,2)=0) #if(j=0 | j=3) #if(clock<=0.5) #if (clock <=0.25) rotate -40*4*clock*y #end #if (clock>0.25 & clock<=0.5) rotate 40*4*(0.5-clock)*y #end #end //clock 0.5 #else //j #if(clock>0.5) #if (clock <=0.75) rotate -40*4*clock1*y #end #if (clock>0.75) rotate 40*4*(0.5-clock1)*y #end #end //clock 0.5 #end //j #else //mod #if(j=1 | j=2) #if(clock<=0.5) #if (clock <=0.25) rotate -40*4*clock*y #end #if (clock>0.25 & clock<=0.5) rotate 40*4*(0.5-clock)*y #end #end //clock 0.5 #else #if(clock>0.5) #if (clock <=0.75) rotate -40*4*clock1*y #end #if (clock>0.75) rotate 40*4*(0.5-clock1)*y #end #end //clock 0.5 #end //j #end //mod translate <3,0,0> } object { bola translate <3,0,0> } } #if (j=0) #declare p = -1; #end #if (j=1) #declare p = -1; #end #if (j=2) #declare p = 1; #end #if (j=3) #declare p = 1; #end #declare ang1 = -70-30*pos1; #declare ang1b = 10+30*pos1b; object{ parte1 //rotate ang1*x #if (mod(i,2)=0) #if ( j=0 | j=1 ) rotate -100*x #if (clock<=0.5) rotate 20*2*clock0*x #end #if(clock>0.5) rotate 20*2*clock1*x #end #else rotate -80*x #if (clock<=0.5) rotate -20*2*clock0*x #end #if(clock>0.5) rotate -20*2*clock1*x #end #end #else #if ( j=0 | j=1 ) rotate -80*x #if (clock<=0.5) rotate -20*2*clock0*x #end #if(clock>0.5) rotate -20*2*clock1*x #end #else rotate -100*x #if (clock<=0.5) rotate 20*2*clock0*x #end #if(clock>0.5) rotate 20*2*clock1*x #end #end #end rotate h*90*y translate } #declare h = -h; #declare j = j+1; #end #declare i = i+1; #end // Aqui está a cena, finalmente: