// 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 roleta = seed(600); #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.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.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 bola = sphere{ < 0.00, 0.00, 0.00 >, 0.5 texture{ tx_plastico } } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } // ====================================================================== // DESCRIÇÃO DA CENA //object{ chao texture{ tx_xadrez } } //text {ttf "times.ttf" "LAURENTINO" 0.8,0.8 scale<4,4,4>} #macro interpola(t0,v0,t1,v1,tt) #local s1 = (tt-t0)/(t1-t0); #local s2 = 1-s1; (s2*v0+s1*v1) #end #macro interpola4(t0,v0,v1,v2,v3,t3,tt) #local v01 = interpola(t0,v0,t3,v1,tt); #local v12 = interpola(t0,v1,t3,v2,tt); #local v23 = interpola(t0,v2,t3,v3,tt); #local v012 = interpola(t0,v01,t3,v12,tt); #local v123 = interpola(t0,v12,t3,v23,tt); #local v0123 = interpola(t0,v012,t3,v123,tt); (v0123) #end #macro grafico(x0,y0, y1, y2, y3, x3, N) #local peso = 0; #while(peso <= N) #local e1 = peso/N; #local e2 = 1 - e1; #local xx = e2*x0+e1*x3; #local yy=interpola4(x0,y0,y1,y2,y3,x3,xx); union{ object{sphere{ < 0, xx, yy >, 0.5 texture{ tx_plastico } } } } #local peso = peso + 1; #end #end #macro uniao(v0,v1,v2,v4,v5,v7,v8,v10,v11,v12,x0,x3,x6,x9,x12,N) #local v3 = (v2+v4)/2; #local v6 = (v5+v7)/2; #local v9 = (v8+v10)/2; union{ grafico(x0,v0,v1,v2,v3,x3,N) grafico(x3,v3,v4,v5,v6,x6,N) grafico(x6,v6,v7,v8,v9,x9,N) grafico(x9,v9,v10,v11,v12,x12,N) } #end uniao(0,5,-10,15,-20,25,-30,35,40,45,0,10,20,30,40,100) #include "camlight.inc" #include "eixos.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 100.0; #declare dir_camera = < 1.00, 0.00, 0 >; #declare dist_camera = 100.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)