// Last edited on 2003-12-07 13:33:20 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, 0, 15.0 >; #declare camDir = < 50, 50, 50 >; camera { location ctr + 0.55*camDir right -1.00*x up 0.75*y sky y look_at ctr } light_source { < 50.00, 100.00, 80.00 > color rgb 1.2*< 1,1,1 > } light_source { < 80.00, 100.00, 50.00 > color rgb 0.5*< 1,1,1 > } light_source { < 70.00, 100.00, 70.00 > color rgb 0.6*< 1,1,1 > } light_source { < 50.00, 100.00, -50.00 > color rgb 0.5*< 1,1,1 > } #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); #while (i < 7) #declare j =1; #while (j<3) #declare alfa1 = -45+90*rand(gerador); #declare alfa2 = -45+90*rand(gerador); #declare alfa3 = -70+140*rand(gerador); #declare alfa4 = -90+180*rand(gerador); #declare beta1 = 45*rand(gerador); #declare segmento_4 = union { sphere { <0,0,0> , 0.5 } cone { <0,0,0>, 0.5,<1,0,0>,0.01 } texture{ DMFWood2 } } #declare segmento_3 = union { sphere { <0,0,0> , 0.7 } cone { <0,0,0>, 0.7,<2,0,0>,0.5 } object{ segmento_4 rotate z*alfa4 translate <2,0,0> } texture{ DMFWood2 } } #declare segmento_2 = union { sphere { <0,0,0> , 1 } cone { <0,0,0>, 1,<4,0,0>,0.7 } object{ segmento_3 rotate z*alfa3 translate <4,0,0> } texture{ DMFWood2 } } #declare segmento_1 = union { sphere { <0,0,0> , 1.5 } cone { <0,0,0>, 1.5,<6,0,0>,1 } object{ segmento_2 rotate z*alfa2 translate <6,0,0> } texture{ DMFWood2 } } #if(j=1) //perna esquerda object{ segmento_1 rotate z*alfa1 rotate y*beta1 translate <5,0,6*(i-1)> } #else //perna direita object{ segmento_1 rotate z*alfa1 rotate y*beta1 translate <5,0,6*(i-1)> scale <-1,1,1> } #end #declare j=j+1; #end #declare i=i+1; #end #declare corpo = union { sphere {<0,0,0> , 5} cylinder{<0,0,0>,<0,0,30>, 5} sphere {<0,0,30> , 5} texture{ Cherry_Wood } } object{ corpo } plane { y, -10 pigment {color White} }