// Last edited on DATE TIME by USER // Processed by remove-cam-lights #include "retalho.inc" #include "textures.inc" background{ color rgb < 0.8, 0.8, 1 > } #declare tx_grama = texture{ pigment{ color rgb < 0.14, 0.56, 0.14 >} finish{ diffuse 0.7 ambient 0.5 } } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > } finish{ diffuse 0.7 ambient 0 specular 0.5 roughness 0.005 } } #declare tx_arvore = texture{ pigment{ color rgb < 0.64, 0.16, 0.16 > } finish{ diffuse 0.2 ambient 0.1 } } #declare tx_prata = texture{ pigment{ color rgb < 0.3, 0.3, 0.3 > } finish{ diffuse 0.2 reflection 0.6 brilliance 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > filter 0.90 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02} } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.98, 0.44, 0.2 >, color rgb < 1, 1, 1 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } #macro interpola(t0,v0,t1,v1,tt) #local ss = (tt- t0)/(t1-t0); #local rr = 1 - ss; (rr*v0 + ss*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); interpola(t0,v012,t3,v123,tt); #end #macro pista(x0,y11,y12,x1,y21,y22,x2,y31,y32,x3,y41,y42,x4,N) #local y0 = (y11 + y42)/2; trecho(x0,y0,y11,y12,(y12 + y21)/2,x1,N) trecho(x1,(y12 + y21)/2,y21,y22,(y22 + y31)/2,x2,N) trecho(x2,(y22 + y31)/2,y31,y32,(y32 + y41)/2,x3,N) trecho(x3,(y32 + y41)/2,y41,y42,y0,x4,N) #end #macro trecho(x0,y0,y1,y2,y3,x3,N) #local d = (x3 - x0)/N; #local i = 0; #local xx = x0; #while(i < N) #local yy = interpola4(x0,y0,y1,y2,y3,x3,xx); object{ sphere { yy, 0.15 pigment{color rgb < i/N, 1 - i/N, i/N*N >} } } #local xx = xx + d; #local i = i+1; #end #end #macro pos(x0,y0,y1,y2,y3,x3,tt) #local yy1 = interpola4(x0,y0,y1,y2,y3,x3,tt); #local yy2 = interpola4(x0,y0,y1,y2,y3,x3,tt+0.01); #local yy3 = interpola4(x0,y0,y1,y2,y3,x3,tt+0.02) #local yy4 = interpola4(x0,y0,y1,y2,y3,x3,tt+0.03); object{ sphere { yy1, 0.3 pigment{color rgb < 0.5, 0.5, 0.5 >} } } object{ sphere { yy2, 0.3 pigment{color rgb < 0.5, 0.5, 0.5 >} } } object{ sphere { yy3, 0.3 pigment{color rgb < 0.5, 0.5, 0.5 >} } } object{ sphere { yy4, 0.3 pigment{color rgb < 0.5, 0.5, 0.5 >} } } #end #macro trajeto(x0,y11,y12,x1,y21,y22,x2,y31,y32,x3,y41,y42,x4,tt) #local y0 = (y11 + y42)/2; #if( tt < x1) pos(x0,y0,y11,y12,(y12 + y21)/2,x1,tt) #else #if (tt < x2) pos(x1,(y12 + y21)/2,y21,y22,(y22 + y31)/2,x2,tt) #else #if (tt < x3) pos(x2,(y22 + y31)/2,y31,y32,(y32 + y41)/2,x3,tt) #else pos(x3,(y32 + y41)/2,y41,y42,y0,x4,tt) #end #end #end #end #macro retalho3(p11,p12,p13,p14,p21,p22,p23,p24,p31,p32,p33,p34,q21,q22,q23,q24,q31,q32,q33,q34,r21,r22,r23,r24,r31,r32,r33,r34,r41,r42,r43,r44,rad,txg,txr) object{retalho(p11,p12,p13,p14,p21,p22,p23,p24,p31,p32,p33,p34,(p31 + q21)/2,(p32 + q22)/2,(p33 + q23)/2,(p34 + q24)/2, rad,txg,txr)} object{retalho((p31 + q21)/2,(p32 + q22)/2,(p33 + q23)/2,(p34 + q24)/2,q21,q22,q23,q24,q31,q32,q33,q34,(q31 + r21)/2,(q32 + r22)/2,(q33 + r23)/2,(q34 + r24)/2, rad,tx_grama,tx_grama) } object{retalho((q31 + r21)/2,(q32 + r22)/2,(q33 + r23)/2,(q34 + r24)/2,r21,r22,r23,r24,r31,r32,r33,r34,r41,r42,r43,r44, rad,tx_grama,tx_plastico) } #end #declare raio = 0.5; #declare origem = <0,0,0>; #declare aureo = (sqrt(3) + 1)/2; #declare chao = box{ <40,40,-5>, <-40,-40, -4> texture{tx_xadrez} } #include "eixos.inc" pista(0,<3,2,3>,<4,4,1>,0.25,<6,8,0>,<4,0,0>,0.5,<-4,4,1>,<6,6,4>,0.75,<6,6,6>,<8,8,4>,1,200) trajeto(0,<3,2,3>,<4,4,1>,0.25,<6,8,0>,<4,0,0>,0.5,<-4,4,1>,<6,6,4>,0.75,<6,6,6>,<8,8,4>,1,clock) #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 10; #declare dir_camera = <0,3,3 >; #declare dist_camera = 60; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)