// Last edited on 2003-12-08 19:41:34 by stolfi // MC930 - Trabalho prático 7 - 2s2003 // Fernando Kenji Iwai #include "colors.inc" #include "woods.inc" #include "textures.inc" background{ SummerSky } #declare ctr = < 0, -3, 22+40*clock>; #declare camDir = < 50, 30, 30 >; camera { location ctr + 0.85*camDir right -1.00*x up 0.75*y sky y look_at ctr } light_source { 10*< 60.00, 100.00, 10.00 > color rgb 0.5*< 1,1,1 > } light_source { 10*< 10.00, 100.00, 60.00 > color rgb 0.5*< 1,1,1 > } light_source { 10*< 60, 100.00, 60.00 > color rgb 0.7*< 1,1,1 > } #declare Preto = pigment{ color rgb < 0.2, 0.2, 0.2 > } #declare tx1 = texture { pigment { Pink } finish { diffuse 0.8 specular 0.1 roughness 0.005 ambient 0.2 } } #declare i = 1; //Gera os nos #declare gerador = seed(1234517); #declare PI = 3.1415; #declare deltax = 45*cos(2*PI*clock); #declare deltaz = 0.0; #while (i < 7) #declare j =1; #while (j <3) #if(j=1) #declare clockp = clock; #else #declare clockp = mod(clock+0.5,1); #end #if(mod(i,2)=0) #declare clockp = clock; #else #declare clockp = mod(clock+0.5,1); #end #declare segmento_4 = union { sphere { <0,0,0> , 0.5 } cone { <0,0,0>, 0.5,<2,0,0>,0.01 } } #declare segmento_3 = union { sphere { <0,0,0> , 0.7 } cone { <0,0,0>, 0.7,<3,0,0>,0.5 } object{ segmento_4 rotate z*(15*cos(2*PI*clockp)-15) translate <3,0,0> } } #declare segmento_2 = union { sphere { <0,0,0> , 1 } cone { <0,0,0>, 1,<5,0,0>,0.7 } object{ segmento_3 rotate z*(17.5*cos(2*PI*clockp)-27.5) translate <5,0,0> } } #declare segmento_1 = union { sphere { <0,0,0> , 1.5 } cone { <0,0,0>, 1.5,<8,0,0>,1 } object{ segmento_2 rotate z*(30*cos(2*PI*clockp)-40) rotate y*(30*cos(2*PI*clock)) translate <8,0,0> } } #if(j=1) object{ segmento_1 rotate z*(15*cos(2*PI*clockp)+20) #if(clockp<0.4) rotate -30*y #else #if(clockp<0.6) rotate y*(-30+(clockp-0.4)*60/0.2) #else rotate 30*y #end #end translate <6,0,6*i+40*clock> #if(mod(i,2)=0) pigment{ Preto } #else pigment{color Red} #end } #else object{ segmento_1 rotate z*(15*cos(2*PI*clockp)+20) #if(clockp<0.4) rotate -30*y #else #if(clockp<0.6) rotate y*(-30+(clockp-0.4)*60/0.2) #else rotate 30*y #end #end translate <6,0,6*i+40*clock> scale <-1,1,1> #if(mod(i,2)=0) pigment{ Preto } #else pigment{color Red} #end } #end #declare j = j + 1; #end object{ sphere {<0,0,6*i+40*clock>, 6 #if(mod(i,2)=0) pigment{ Preto } #else pigment{color Red} #end }} #declare i=i+1; #end plane { y, 0 pigment{ checker color rgb <0.5,0.6,0.7>, color rgb <0.2,0.5,0.6> } finish{ diffuse 0.8 ambient 0.2 } scale 0.5*40 translate -8*y }