/* Feito por Andre Cesarino, RA 041939.*/ #include "eixos.inc" #include "camlight.inc" #declare tempo = array[9] {0.0, 0.125, 0.250, 0.375, 0.500, 0.625, 0.750, 0.825, 1.000}; #declare centro_cena = < 10.00, 5.00, 0.00 >; #declare raio_cena = 20.0; #declare dir_camera = < 0.00, -1.00, 10.00 >; #declare dist_camera = 20.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz) background{ color rgb < 0.50, 0.50, 0.50> } #declare cinza_brilhante = texture { pigment{ color rgb <0.50, 0.50, 0.50>} finish { diffuse 1 specular 0.5} } #declare vermelho_fosco = texture { pigment{ color rgb <1.00, 0.00, 0.00>} finish { diffuse 1 specular 0.2 } } #declare amarelo_fosco = texture { pigment{ color rgb <1.00, 1.00, 0.00>} finish { diffuse 1 specular 0.2 } } #declare azul_fosco = texture { pigment{ color rgb <0.00, 0.00, 1.00>} finish { diffuse 1 specular 0.2 } } #declare azul_transparente = texture { pigment{ color rgb <0.10,0.10,0.80> filter 0.4} finish{diffuse 0.05 reflection 0.25 specular 0.25} } #declare amarelo_transparente = texture { pigment{color rgb <1.00,1.00,0.00>} finish{diffuse 0.05 reflection 0.25 specular 0.25} } #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_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} } /* DESCRICAO DA CENA */ #declare chao = box{ <-100,-100,-1>, <+100,+100,0>} #macro interpola (f0,v0,f1,v1,f) #local ss = (f-f0)/(f1-f0); #local rr = 1 - ss; (rr*v0 + ss*v1) #end #macro interpola_bezier (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 trajetoria_com_pingos (x0,y0,y1,y2,y3,x3,N) union { #local i = 0; #local inc_x = (x3-x0) / N; #local xx = x0; #while (i < N) #local xx = x0 + i * inc_x; #local yy = interpola_bezier(x0,y0,y1,y2,y3,x3,xx); #debug str(xx,8,6) #debug str(yy,8,6) sphere{,0.2} #local i = i+1; #end } #end #macro trajetoria_composta (x0,x1,x2,x3,x4,y0,y1,y2,y3,y4,y5,y6,y7,y8,y9,N) union { object {trajetoria_com_pingos (x0,y0,y1,y2,(y2+y3)/2,x1,N/4) texture{vermelho_fosco}} object {trajetoria_com_pingos (x1,(y2+y3)/2,y3,y4,(y4+y5)/2,x2,N/4) texture{amarelo_fosco}} object {trajetoria_com_pingos (x2,(y4+y5)/2,y5,y6,(y6+y7)/2,x3,N/4) texture{azul_fosco}} object {trajetoria_com_pingos (x3,(y6+y7)/2,y7,y8,y9,x4,N/4) texture{vermelho_fosco}} } #end /*Aqui comeca a cena. */ union { object{ eixos(3.00) } object{ chao translate < 0,0,-5> texture {tx_xadrez}} //object{trajetoria_com_pingos (0,5,0,10,5,5,1000) texture{cinza_brilhante}} object{trajetoria_composta (0,5,10,15,20, 5,2,0,3,7,4,10,4,2,5, 1000)} }