background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_bug1 = texture{ pigment{ color rgb < 1.000, 0.500, 0.000 > } finish{ diffuse 0.5 ambient 0.5 } } #declare tx_bug2 = texture{ pigment{ color rgb < 0.500, 0.800, 0.000 > } finish{ diffuse 0.5 ambient 0.5 } } #declare tx_bug3 = texture{ pigment{ color rgb < 1.000, 0.000, 0.500 > } finish{ diffuse 0.5 ambient 0.5 } } #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 chao = box{ <-20,-20,-1>, <+20,+20,0> texture{tx_xadrez}} #declare toco= cylinder { <0,0,0>, <0.1,0,0>, 0.05 texture{ pigment{ color rgb < 0.5, 0.5, 0.5 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } } #declare tocos1 = array[1] {<0.45,0,0.8>} #declare vertice1= union { cylinder { <0,0,0>, <0,0,0.3>, 0.5 texture{ pigment{ color rgb < 0.90, 0.30, 0.30 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } } cylinder { <0,0,0.3>, <0,0,1.0>, 0.35 texture{ pigment{ color rgb < 0.80, 0.30, 0.30 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } } object { toco translate<0.35,0,0.8> } } #declare tocos2= array[2] {<0.17,0,0.8>,<-0.17,0,0.8>} #declare vertice2= union { box { <-0.5,-0.5,0>, <0.5,0.5,0.2> texture{ pigment{ color rgb < 0.6, 0.6, 0.30 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } } cone { <0,0,0.2>, 0.4 <0,0,1>, 0 texture{ pigment{ color rgb < 0.8, 0.8, 0.30 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } } object { toco translate<0.07,0,0.8> } object { toco rotate 180*z translate<-0.07,0,0.8> } } #declare tocos3= array[3] {<0.3,0,0.8>,<-0.15,0.258,0.8>,<-0.15,-0.258,0.8>} #declare vertice3= union{ sphere{ <0,0,0.3>, 0.3 texture{ pigment{ color rgb < 0.3, 0.9, 0.3 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } } sphere { <0,0,0.8>, 0.2 texture{ pigment{ color rgb < 0.4, 0.9, 0.4 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } } object { toco translate<0.2,0,0.8> } object { toco rotate 120*z translate<-0.1,0.172,0.8> } object { toco rotate 240*z translate<-0.1,-0.172,0.8> } } #declare tocos4= array[4] {<0.4,0,0.8>,<0,0.4,0.8>,<-0.4,0,0.8>,<0,-0.4,0.8>,} #declare vertice4= union { box{ <-0.4,-0.4,0>, <0.4,0.4,0.5> texture{ pigment{ color rgb < 0.9, 0.9, 0.9 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } } box{ <-0.3,-0.3,0.5>, <0.3,0.3,1> texture{ pigment{ color rgb < 1, 1, 1 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } } object { toco translate<0.3,0,0.8> } object { toco rotate 90*z translate<0,0.3,0.8> } object { toco rotate 180*z translate<-0.3,0,0.8> } object { toco rotate 270*z translate<0,-0.3,0.8> } } #macro interpola(ti,t0,v0,t1,v1) #local ss = (ti-t0)/(t1-t0); #local vv = (1-ss)*v0+ss*v1; vv #end #macro testa_interpola_1(p0,p1,n,raio) union{ #local i = 0; #while (i < n) sphere{ interpola(i,0,p0,n,p1), raio texture{ tx_bug1 } } #local i = i+1; #end } #end #macro bezier2(ti,t0,t1,p0,p1,p2) #local b1 = interpola(ti,t0,p0,t1,p1); #local b2 = interpola(ti,t0,p1,t1,p2); interpola(ti,t0,b1,t1,b2) #end #macro bezier3(ti,t0,t1,p0,p1,p2,p3) #local b1 = bezier2(ti,t0,t1,p0,p1,p2); #local b2 = bezier2(ti,t0,t1,p1,p2,p3); interpola(ti,t0,b1,t1,b2) #end #macro teste_bezier_1(p0,p1,p2,n,raio) #local i = 0; #while (i < n) sphere{ bezier2(i,0,n,p0,p1,p2), raio texture{ tx_bug2 } } #local i = i+1; #end #end #macro teste_bezier_2(p0,p1,p2,p3,n,raio) #local i = 0; #while (i < n) sphere{ bezier3(i,0,n,p0,p1,p2,p3), raio texture{ tx_bug3 } } #local i = i+1; #end #end #include "eixos.inc" union { // object{ eixos(5) } object {vertice1 } object {vertice2 translate <2,0,0>} object {vertice3 translate <4,0,0>} object {vertice4 translate <6,0,0>} union{ testa_interpola_1(<0,0,+1>,<6,0,+1>,500,0.03) teste_bezier_1(<0,0,+1>,<5,5,+1>,<6,0,+1>,500,0.03) teste_bezier_2(<0,0,+1>,<2,6,+1>,<4,-6,+1>,<6,0,+1>,500,0.03) translate <0,-4,0> } teste_bezier_2(tocos4[1]+<6,0,0>,<5.3,2,0>,<4.7,-2,0>,tocos3[2]+<4,0,0>,300,0.03) teste_bezier_2(tocos3[1]+<4,0,0>,<2.7,2,0>,<2.7,-2,0>,tocos2[0]+<2,0,0>,300,0.03) teste_bezier_2(tocos2[1]+<2,0,0>,<0.4,2,0>,<0.7,-2,0>,tocos1[0]+<0,0,0>,300,0.03) } #declare cmin = < -0.5,-6,-0.5 >; #declare cmax = < +6.5,+2,+1.0 >; box{ cmin-<2,2,0> +<2,2,0.01> texture{ pigment{ color rgb 0.9*<1,1,1> } finish {diffuse 0.7 ambient 0.3 } } } #include "camlight.inc" #declare centro_cena = (cmin + cmax)/2; #declare raio_cena = 0.5*vlength(cmin - cmax); #declare dir_camera = < 3, 4, 2 >; #declare dist_camera = 7*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)