// 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.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.95, 0.70 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_nota = texture{ pigment{ color rgb < 0.00, 0.80, 0.00 > } } #declare tx_metal = texture{ pigment{color rgb < 1.00, 0.00, 0.00 > } finish{ reflection 0.30 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 0.85, 0.30 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > 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 } #declare tx_xadrez2 = texture{ pigment{ checker color rgb < 0.00, 0.00, 0.00 >, color rgb < 1.00, 1.00, 1.00 > } finish{ diffuse 1.0 ambient 1.0 } scale 5.0 } // ====================================================================== // DESCRIÇÃO DA CENA #macro interpola(f0,v0,f1,v1,f) #local s1 = (f-f0)/(f1-f0); #local s2 = 1-s1; (s2*v0+s1*v1) #end #macro interpola4(f0,v0,v1,v2,v3,f3,f) #local v01 = interpola(f0,v0,f3,v1,f); #local v12 = interpola(f0,v1,f3,v2,f); #local v23 = interpola(f0,v2,f3,v3,f); #local v012 = interpola(f0,v01,f3,v12,f); #local v123 = interpola(f0,v12,f3,v23,f); #local v0123 = interpola(f0,v012,f3,v123,f); (v0123) #end #macro grafico(x0,y0,y1,y2,y3,x3,N) union{ #local peso = 0; #while (peso<=N) #local s1 = peso/N; #local s2 = 1-s1; #local vx = s2*x0+x3*s1; #local vy = interpola4(x0,y0,y1,y2,y3,x3,vx); #local peso = peso + 1; object{sphere{ vy, 1 }texture{tx_xadrez} } #end } #end #declare chao = box{ <+20.00,-20.00,-1.00>, <-20.00,+20.00,-0.00> } #macro grafico4(x0,x1,x2,x3,y11,y12,y21,y22,y31,y32,y41,y42,N) union{ object{grafico(x0,((y11+y42)/2),y11,y12,((y12+y21)/2),x1,N)} object{grafico(x1,((y12+y21)/2),y21,y22,((y22+y31)/2),x2,N)} object{grafico(x2,((y22+y31)/2),y31,y32,((y32+y41)/2),x3,N)} object{grafico(x3,((y32+y41)/2),y41,y42,((y11+y42)/2),x0,N)} } #end #include "eixos.inc" #include "retalho.inc" #macro retalho2(p11,p12,p13,p14,p21,p22,p23,p24,p31,p32,p33,p34,p41,p42,p43,p44,p51,p52,p53,p54 ,p61,p62,p63,p64,rad,txg,txr) union{ object{retalho(p11,p12,p13,p14,p21,p22,p23,p24,p31,p32,p33,p34,((p41+p31)/2),((p42+p32)/2),((p43+p33)/2),((p44+p34)/2), rad,txg,txr)} object{retalho(((p41+p31)/2),((p42+p32)/2),((p43+p33)/2),((p44+p34)/2),p11,p12,p13,p14,p21,p22,p23,p24,p31,p32,p33,p34, rad,txg,txr)} } #end union{ union{ object{retalho2(<20,15,-10>,<5,-5,-8>,<12,-12,13>,<4,-4,8>,<0,0,-7>,<-3,12,-8>,<-4,-4,-4>,<9,-5,0>,<0,7,6>,<8,-3,4>,<-9,-7,5>,<7,8,-10>,<0,0,0>,<13,-5,-8>,<5,5,5>,<10,-10,6>,<10,-8,-9,>,<15,-3,8,>,<14,-13,-10>,<10,10,10>,<-4,4,-4>,<5,15,-6>,<-6,-6,-6>,<8,-8,7>,0.1,tx_vidro,tx_xadrez)} } object{grafico4(0,10,15,50,<0,7,6>,<8,-3,4>,<-9,-7,5>,<7,8,-10>,<0,0,0>,<13,-5,-8>,<5,5,5>,<10,-10,6>,500) translate<0,0,20>} } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 8.00 >; #declare raio_cena = 100.0; #declare dir_camera = < 8, 0, 0.00 >; #declare dist_camera = 100.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)