// Last edited on DATE TIME by USER // Processed by remove-cam-lights #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 = < 0.00, 1.00, 0.00 >; #declare raio_cena = 15.0; #declare dir_camera = < 10.00, 5.00, 5.00 >; #declare dist_camera = 15.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} } #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 grafico(x0,y0,y1,y2,y3,x3,n) #local i = 0; #local delta = (x3-x0)/n; #local xx = x0; union { #while (i < n) #local yy = interpola_bezier(x0,y0,y1,y2,y3,x3,xx); object { sphere{<0,0,0>, 0.1} translate yy } #local i = i+1; #local xx = xx + delta; #end } #end #macro trajetoria_tempo(x0,y0,y1,y2,y3,x3,n,fase) #local i = 0; #local delta = (x3-x0)/n; #local xx = x0; union { #local fase = fase*4; #local xx = x0*(1-fase) + fase*x3; #local yy = interpola_bezier(x0,y0,y1,y2,y3,x3,xx); object { sphere{<0,0,0>, 0.4} translate yy } } #end #macro quatro_graficos(x0,y0,c1y1,c1y2,c2y1,c2y2,c3y1,c3y2,c4y1,c4y2,c4y3,xfim) #local c2y0 = (c2y1+c1y2)/2; #local c1y3=c2y0; #local c3y0 = (c3y1+c2y2)/2; #local c2y3=c3y0; #local c4y0 = (c4y1+c3y2)/2; #local c3y3=c4y0; #local dist = (xfim-x0)/4; union { grafico(x0,(y0+c4y3)/2,c1y1,c1y2,c1y3,x0+dist,nbolinhas) grafico(x0+dist,c2y0,c2y1,c2y2,c2y3,x0+dist*2,nbolinhas) grafico(x0+dist*2,c3y0,c3y1,c3y2,c3y3,x0+dist*3,nbolinhas) grafico(x0+dist*3,c4y0,c4y1,c4y2,(y0+c4y3)/2,x0+dist*4,nbolinhas) } #end #macro trajetoria4_tempo(x0,y0,c1y1,c1y2,c2y1,c2y2,c3y1,c3y2,c4y1,c4y2,c4y3,xfim) #local fase = clock; #local c2y0 = (c2y1+c1y2)/2; #local c1y3=c2y0; #local c3y0 = (c3y1+c2y2)/2; #local c2y3=c3y0; #local c4y0 = (c4y1+c3y2)/2; #local c3y3=c4y0; #local dist = (xfim-x0)/4; union { #if(fase<0.25) trajetoria_tempo(x0,(y0+c4y3)/2,c1y1,c1y2,c1y3,x0+dist,nbolinhas,fase) #else #if((fase>=0.25) & (fase<0.50)) trajetoria_tempo(x0+dist,c2y0,c2y1,c2y2,c2y3,x0+dist*2,nbolinhas,fase-0.25) #else #if((fase>=0.50) & (fase<0.75)) trajetoria_tempo(x0+dist*2,c3y0,c3y1,c3y2,c3y3,x0+dist*3,nbolinhas,fase-0.50) #else trajetoria_tempo(x0+dist*3,c4y0,c4y1,c4y2,(y0+c4y3)/2,x0+dist*4,nbolinhas,fase-0.75) #end #end #end } #end #macro tresretalhos() #local pm00 = (p02[0] + p10[0])/2; #local pm01 = (p02[1] + p10[1])/2; #local pm02 = (p02[2] + p10[2])/2; #local pm03 = (p02[3] + p10[3])/2; #local pm10 = (p11[0] + p20[0])/2; #local pm11 = (p11[1] + p20[1])/2; #local pm12 = (p11[2] + p20[2])/2; #local pm13 = (p11[3] + p20[3])/2; union { object { retalho(p00[0],p00[1],p00[2],p00[3],p01[0],p01[1],p01[2],p01[3],p02[0],p02[1],p02[2]p02[3],pm00,pm01,pm02,pm03,radiusomg,tx_fosca,tx_plastico) } object { retalho(pm00,pm01,pm02,pm03,p10[0],p10[1],p10[2],p10[3],p11[0],p11[1],p11[2],p11[3],pm10,pm11,pm12,pm13,radiusomg,tx_fosca,tx_plastico) } object { retalho(pm10,pm11,pm12,pm13,p20[0],p20[1],p20[2],p20[3],p21[0],p21[1],p21[2],p21[3],p22[0],p22[1],p22[2],p22[3],radiusomg,tx_fosca,tx_plastico) } } #end #declare nbolinhas = 300; #declare curva = array[10] {<1,2,2>,<0,3,1>,<1,10,1>,<1,3,2>,<0,5,6>,<3,5,6>,<3,5,0>,<2,4,1>,<1,1,1>,<3,-1,2>} #declare p00 = array[4] { <0,0,0> , <-1,0,0> , <-2,0,0> , <-3,0,0> } #declare p01 = array[4] { <0,1,0> , <-1,1,0> , <-2,1,0> , <-3,1,0> } #declare p02 = array[4] { <0,2,2> , <-1,2,2> , <-2,2,2> , <-3,2,2> } #declare p10 = array[4] { <0,4,0> , <-1,4,0> , <-2,4,0> , <-3,4,0> } #declare p11 = array[4] { <0,5,-1>, <-1,5,-1>, <-2,5,-1> , <-3,5,-1> } #declare p20 = array[4] { <0,8,3> , <-1,8,3> , <-2,8,3> , <-3,8,3> } #declare p21 = array[4] { <0,9,5> , <-1,9,5> , <-2,9,5> , <-3,9,5> } #declare p22 = array[4] { <0,10,2>,<-1,10,2> , <-2,10,2> , <-3,10,2> } #declare tempo = array[2] {0,16} #declare radiusomg = 0.05; #include "retalho.inc" union { object{ eixos(3.00) } object{ trajetoria4_tempo(tempo[0],curva[0],curva[1],curva[2],curva[3], curva[4],curva[5],curva[6],curva[7],curva[8],curva[9],tempo[1]) texture{ amarelo_fosco}} object{ quatro_graficos (tempo[0],curva[0],curva[1],curva[2],curva[3], curva[4],curva[5],curva[6],curva[7],curva[8],curva[9],tempo[1]) texture{ azul_fosco}} }