// Last edited on 2004-01-22 22:38:03 by stolfi // Vitor Sexto Bernardes - RA 010063 // Variaveis de controle #declare esp_nos_x = 7; #declare esp_nos_y = 6; // ====================================================================== #declare ctr = < esp_nos_x, esp_nos_y+1, 0.00 >; #declare camDir = < 0, 19, 11 >; camera { location ctr + 1.00*camDir right -1.00*x up 0.75*y sky z look_at ctr } // ====================================================================== // FONTES DE LUZ light_source { 10 * < 5, 20, 30 > // Posição da lâmpada. color rgb 1.2 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source { 10 * < 5, -20, 30 > // Posição da lâmpada. color rgb 0.6 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // DESCRIÇÃO DA CENA background { color rgb < 0, 0, 0 > } #declare tx_nos = texture { pigment { color rgb < 0.4, 0.4, 1> } } #declare tx_conexoes = texture { pigment { color rgb < 0.8, 0.8, 0.8 > } finish { metallic } } #declare nos = union { // Faz as linhas de fora #declare i=0; #while (i <= 1) #declare j=0; #while (j <= 2) sphere { , 1 texture { tx_nos } } #declare j=j+1; #end #declare i=i+1; #end // Faz a linha do meio #declare i=0; #while (i <= 1) sphere { , 1 texture { tx_nos } } #declare i=i+1; #end } #declare conexoes = union { #declare i=0; #while (i <= 1) cylinder { <0, esp_nos_y*2*i, 0>, , 0.2 texture { tx_conexoes } } #declare i=i+1; #end #declare i=0; #while (i <= 1) cylinder { , , 0.2 texture { tx_conexoes } } #declare i=i+1; #end #declare i=0; #while (i <= 1) cylinder { , , 0.2 texture { tx_conexoes } } #declare i=i+1; #end } #declare estrela = prism { linear_sweep linear_spline 0, 1, 9, <0, 4>, <1, 1>,<4, 0>,<1, -1>,<0, -4>,<-1, -1>,<-4, 0>,<-1, 1>,<0, 4> scale <0.2, 0.2, 0.2> rotate <0, 0, -30.25> } #declare cubo = box { <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5> } // CENA FINAL: object { nos } object { conexoes } #declare fonte = seed(1436); // Faz cubos #declare i=0; #while (i <= esp_nos_x * 2) #if (rand(fonte) < 0.4) #if (rand(fonte) < 0.5) // desenha em tubo object { cubo translate pigment { color rgb } } #else // desenha no outro tubo object { cubo translate pigment { color rgb } } #end #end #declare i=i+1; #end // Faz estrelas #declare i=0; #while (i <= 9) #declare j=0; #if (rand(fonte) < 0.6) object { estrela // Para mudar de tubo #if (rand(fonte) < 0.5) #declare j=esp_nos_x; #end translate <(esp_nos_x/10)*i + j, (esp_nos_y*2/10)*i, 0> pigment { color rgb } } #end #declare i=i+1; #end