// Last edited on 2003-04-12 08:53:36 by stolfi //Universidade Estadual de Campinas //Instituto de Computação //Aluno: Ricardo Capitanio Martins da Silva //RA: 992386 Disciplina: MC930A //Professor: Stolfi //Trabalho Prático 05 #include "colors.inc" #include "textures.inc" background{ color rgb < 1.00, 1.00, 1.00 > } #declare ctr = <10,0.0,0>; #declare cam = <7,8,30>; camera { angle 15 location ctr + 5.0*cam right 1.20*x up 0.40*y sky <0.00, 1.00, 0.00> look_at ctr } light_source { 10*(vrotate(cam, 20*y) + 20*y) color 1.3*White } light_source { 10*(vrotate(cam, -90*y) + 15*y) color 0.7*White } // Eixos de coordenadas #declare eixoX = cylinder { < -3, 0, 0 >, < 3, 0, 0 >, 0.01 texture {pigment{Red}} } #declare eixoY = cylinder { < 0,-3, 0 >, < 0, 3, 0 >, 0.01 texture { pigment{Blue} } } #declare eixoZ = cylinder { < 0, 0, -3 >, < 0, 0, 3 >, 0.01 texture {pigment{Green}} } #declare corpo_metalico = texture { pigment { Brown } finish { Metallic_Finish reflection .09} } #declare amarelo_transp = texture { pigment { Yellow filter 1} finish { ambient 0.1 diffuse 0.1 reflection 0.35 specular 1 roughness 0.001 } } #declare vermelho_transp = texture { pigment { Red filter 1} finish { ambient 0.1 diffuse 0.1 reflection 0.35 specular 1 roughness 0.001 } } #declare cristal = texture { pigment {White filter 1} finish { ambient 0.1 diffuse 0.1 reflection 0.35 specular 1 roughness 0.001 } } #declare espelho_laranja = texture { pigment {Orange} finish { ambient 0.05 diffuse 0.05 reflection Orange specular 0.2 roughness 0.05 } } #declare e = 0.1; #declare raio = 0.5; #declare inter = 0.3; #declare gerador = seed(123456); #declare pilar = cylinder { <-5, -3, -10>, <-5, 3.5, -10>, raio texture {pigment{Blue}} } #declare estante = union { object {pilar} object {pilar translate<0,0,20>} #declare i = 0; #while (i < 4) #declare cy = i*2 - 2.8; box { #declare x1 = - 5 - raio; #declare x2 = -5 + raio; #declare cy2 = cy + e; , //canto de cima //canto de baixo texture{pigment{Gray}} } #declare i = i + 1; #end } #declare esferas = union { #declare varrido = -9.5; #while (varrido < 9.5) #declare r = 0.6*rand(gerador) + 0.2; #declare y2 = 1.3 + r; #declare z2 = varrido + 0.5; sphere { <-5.0, y2 , varrido>, r texture{pigment{Green}} } #declare varrido = z2 + inter; #end } #declare caixas = union { #declare varrido = -9.5; #while (varrido < 9.5) #declare alt = rand(gerador) + 0.2; #declare y2 = -2.9 + alt; #declare z2 = varrido + 0.5; box { <-5.5,-2.9, varrido>, <-4.5, y2, z2> texture{pigment{Red}} } #declare varrido = z2 + inter; #end } #declare cilindros = union { #declare varrido = -9.5; #while (varrido < 9.5) #declare alt = rand(gerador) + 0.2; #declare y2 = -0.7 + alt; cylinder { <-4.8,-0.7, varrido>, <-4.8, y2, varrido>, 0.2 texture{pigment{Yellow}} } #declare varrido = varrido + inter + 2*0.2; #end } #declare chao = plane { y, -3.0 texture {pigment { checker color White, color Gray }} } #declare supormercado = union { #declare j = 0; #while (j < 7) #declare trans_x = 5*j; object{estante translate} object{caixas translate} object{esferas translate} object{cilindros translate} #declare j = j + 1; #end } union { object{supormercado} object{chao} //somente para mostrar os eixos cartesianos //object{eixoX} // eixo X (Red) //object{eixoY} // eixo Y (Blue) //object{eixoZ} // eixo Z (Green) }