// MP004 - COMPUTACAO GRAFICA // NOME: LUCIANA RAMOS // RA: 007868 // Last edited on 2001-06-09 21:42:40 by stolfi // TRABALHO DE LABORATORIO 5 // COMANDOS DE REPETIÇÃO E NÚMEROS ALEATÓRIOS #include "colors.inc" background{ color rgb < 0.70, 0.70, 0.70 > } light_source { < -50.00, 120.00, 120.00 > color rgb < 1.00, 1.00, 1.00 > } camera { angle 10 location 1.4 * <50, 100, 120> look_at <0,0,0> } #declare cor_cristal = < 0.75, 0.60, 0.50 > #declare tx_cristal = texture { finish { ambient 0.1 diffuse 0.1 reflection 0.25 specular 1 roughness 0.001 } pigment { color cor_cristal filter 1 } } #declare x1 = cylinder { < +100.00, 0.00, 0.00 >, < -100.00, 0.00, 0.00 >, 0.01 texture { pigment { color rgb < 1.00, 0.00, 0.00 > } } } #declare y1 = cylinder { < +0.00, 100.00, 0.00 >, < 0.00, -100.00, 0.00 >, 0.01 texture { pigment { color rgb < 0.00, 1.00, 0.00 > } } } #declare z1 = cylinder { < 0.00, 0.00, 100.00 >, < 0.00, 0.00, -100.00 >, 0.01 texture { pigment { color rgb < 0.00, 0.00, 1.00 > } } } #declare cilindro = cylinder { < -12.00, -3.00, 0.00 >, < -12.00, 3.00, 0.00 >, 1.0 texture { pigment { color rgb < 1.00, 0.50, 0.00 > } } } // Aqui está a cena, finalmente: union{ /* object{ x1 } object{ y1 } object{ z1 } */ plane {<0,1,0>,-8 pigment { checker color <1,1,1>, color <0.95, 0.95, 0.95>} } #declare g = seed (12345) #declare posx = -18; #declare centro = 6; #declare i = 1; #while (i < 12) #if (i = centro) #declare j = 1 #while (j < 6) box { < 0.4*j, 0.4*j, 0.4*j> , <-0.4*j,-0.4*j, -0.4*j> texture { tx_cristal } hollow interior { ior 1.0 } } #declare j =j + 1 #end #else #declare r = rand(g); #declare alt = 3*r; //coluna da torre cylinder { < posx + (i*3), -3.00, 0.00 >, < posx + (i*3), 3.00 + alt , 0.00 >, 1.0 texture { pigment { color rgb < 1.00*r, 0.60*r, 0.00 > } } } //chapeu da torre cone { < posx + (i*3), 3.00 + alt, 0.00 >, 1.0 < posx + (i*3), 4.00 + alt, 0.00 >, 0.1 texture { pigment { color rgb < 1.00*r, 0.60*r, 0.00 > } } } #end //fim do if #declare i = i + 1; #end }