// Exercicio 9 - MC930 // Last edited on 2003-05-31 15:11:58 by stolfi // Nilton Volpato - RA 003243 // Está na cara // Imagem 300x400 pixels ou proporcional (3 por 4) #declare imgname = "nilton.png"; #declare ctr = <0,0,0>; camera { location ctr + 2.1 * <0,0,-30> right 1.0*x up 0.50*y sky y look_at ctr } #include "colors.inc" #include "textures.inc" #include "woods.inc" #include "golds.inc" #include "metals.inc" background { color LightBlue } light_source { 10*< -12, 15, -40 > color 1.2*White } light_source { 10*< +12, 8, -40 > color 0.8*White } light_source { 10*< +3, 4, -40 > color 0.4*White } //---------------------------------------------- // Cores e Texturas #default { finish { ambient 0.1 } } #declare textura_face = texture { pigment { image_map { png imgname once } translate <-.5,-.5,0> translate <-.04, 0, 0> // ajustes fino scale 24 } } //---------------------------------------------- // Cabeça //#declare cabeca = // sphere { // 0,15 // texture { textura_face } // } #declare use_texture = 1; #declare cabeca = blob { threshold 0.6 sphere { // cabeca <0,0,0>, 40, .7 scale <0.7,1.1,0.76> } cylinder { // pescoço <0,-26,0>, <0,-25,0>, 20, .7 } sphere { // olho direito <-1.7,4.0,-9.25>, 2, -.01 // força negativa scale <1.3, .7, 1> } sphere { // olho esquerdo <2.5,4.0,-9>, 2, -.01 // força negativa scale <1.3, .7, 1> } sphere { // orelha <0,0,0>, 1, 0.2 scale <1,2.5,1> translate <-6.2, 1.5, -2> } sphere { // orelha <0,0,0>, 1, 0.2 scale <1,2.5,1> translate <-6.2, 1.5, -2> scale <-1,1,1> } cylinder { <7, -5.5, -20>, <7,-5.5, 20>, 4, -0.2 scale <1,2,1> } cylinder { <2+5, -1, -50>, <2-5,-1,50>, 1, -0.02 scale <3,3,1> } cylinder { <7, -5.5, -20>, <7,-5.5, 20>, 4, -0.2 scale <1,2,1> scale <-1,1,1> } cylinder { <2+5, -1, -50>, <2-5,-1,50>, 1, -0.02 scale <3,3,1> scale <-1,1,1> } #declare i = 1; #declare max_i = 10; #declare p = <0.4,1.8,-7.5>; #while ( i < 10 ) sphere { <0,0,0>, 2, .01 //scale < 10*i/max_i, 10*i/max_i, 1 > scale <1,1, 2*i/max_i> translate p } #declare i = i+1; #declare p = p + <0,-0.26, -0.1>; #end #declare uu=0; #declare maxuu=2*pi; #declare uustep=pi/30; // 80 #declare vv=0; #declare maxvv=2*pi; #declare vvstep=pi/30; // 80 #while ( uu <= maxuu ) #declare vv=0; #while ( vv <= maxvv ) #declare sx = 11*0.7*cos(uu)*sin(vv); #declare sy = 11*1.1*sin(uu)*sin(vv); #declare sz = 11*0.76*cos(vv); //if ( (11*sy > 6.5) & 11*sz > -6 ) #if ( sy*sqrt(2) + sz*sqrt(2) - 2.5 > 0 ) sphere { , 1, 1 } #end /* sphere { 10* + <.1,0,-.5>, //<.1,10,-.5>, raio_t, 1 texture { cor_tentaculo } } sphere { 11* + <.1,0,-.5>, //<-.5,11,.1>, raio_t, 1 texture { cor_tentaculo } } */ #declare vv=vv+vvstep; #end #declare uu=uu+uustep; #end #if (use_texture) texture { textura_face } #else pigment { color White } #end } /* sphere { <7, -6, -3 >, 6//, -0.2 scale <1,2,1> } */ //---------------------------------------------- // Cena object { cabeca } object { cabeca rotate +53*y translate -18.0*x } object { cabeca rotate -53*y translate +18.0*x } plane { y, -10 pigment { checker color Black color White scale 5 } }