// Last edited on 2003-04-12 04:59:58 by stolfi // Exercicio 4 - MC930 // Nilton Volpato - RA 003243 // Bomba Atomica de Mesa #include "colors.inc" #include "textures.inc" background { color LightBlue } global_settings { max_trace_level 6 } light_source { < -12.00, 18.00, -40.00 > color rgb 1.1*< 1, 1, 1 > } light_source { <0,0,0> color rgb .5 } light_source { <0,2,-10> color rgb .5 } camera { location 1.1*< 3, 7, -30 > right -0.75*x up 1.00*y look_at 0 } //---------------------------------------------- // Cores e Texturas // Vidro #declare vidro = texture { pigment { color White filter 0.96 } finish { specular 1 roughness 0.001 ambient 0 diffuse 0 reflection 0.1 ior 1.5 } } // Metalico #declare metalico = texture { Polished_Chrome } // Verde (uranio) #declare uraniost = texture { pigment { color Green filter 0.2 } finish { specular 1 roughness 0.001 ambient 0.3 diffuse 0 reflection 0.1 } } // Branco (porta-copos) #declare brancopc = texture { pigment { color White } } // Preto (controle remoto) #declare pretocr = texture { finish { phong 1 reflection .15 } pigment { bozo scale 0.3 turbulence 1 color_map { [ 0.5, rgbt <0.1,0.1,0.1,0> ][ 1.0, rgbt <.1,.1,.1> + <0.1,0.1,0.1,0> ] } } } // Vermelho (botao de detonacao) #declare vermelhobd = texture { pigment { color Red } } //---------------------------------------------- // Uranio esferico semi-transparente #declare uranio = sphere { 0, 2 texture { uraniost } interior { ior 2.0 } } #declare cristal_aux1 = union { cone { <0,0,0>, 5, <0,10,0>, 1 } cone { <0,0,0>, 5, <0,-10,0>, 1 } } #declare cristal_aux2 = difference { object { cristal_aux1 } object { cristal_aux1 scale .95 } } light_source { <0,-5,0> color rgb .7 } // Cristal isolador de radio-atividade #declare cristal = union { object { cristal_aux2 } difference { union { object { uranio translate <0,-8,0> } object { uranio translate <0,-5,0> } object { uranio translate < 2,-5, 2> } object { uranio translate < 2,-5,-2> } object { uranio translate <-2,-5, 2> } object { uranio translate <-2,-5,-2> } object { uranio translate <0,-3,0> } object { uranio translate < 2,-3, 2> } object { uranio translate < 2,-3,-2> } object { uranio translate <-2,-3, 2> } object { uranio translate <-2,-3,-2> } object { uranio translate <0,0,0> } object { uranio translate < 2,0, 2> } object { uranio translate < 2,0,-2> } object { uranio translate <-2,0, 2> } object { uranio translate <-2,0,-2> } object { uranio translate <0,4,0> } object { uranio translate < 2,4, 2> } object { uranio translate < 2,4,-2> } object { uranio translate <-2,4, 2> } object { uranio translate <-2,4,-2> } } object { cristal_aux1 scale .95 inverse} } } // Antena Disfarcada #declare antenad = union { torus { 1, .8 } cylinder { <0,0,0>, <0,2,1>, 1 } } // Aro de Vedacao #declare aro = difference { torus { 5, .2 } object { cristal } } // Base para Suporte #declare base = difference { torus { 1, .8 } object { cristal translate <0,10,0>} plane { y, 0 } } // Porta Copos #declare porta_copos = difference { superellipsoid { <0.2, 0.3> scale <1, .1, 1> scale 6 } cylinder { < 3,.1, 3>, < 3,2, 3>, 2 } cylinder { < 3,.1,-3>, < 3,2,-3>, 2 } cylinder { <-3,.1, 3>, <-3,2, 3>, 2 } cylinder { <-3,.1,-3>, <-3,2,-3>, 2 } } #declare bomba = union { object { cristal texture { vidro } translate .5*y } object { antenad texture { metalico } translate <0,10,0> + .5*y } object { aro translate .5*y texture { metalico } } object { base translate <0,-10,0> + .5*y texture { metalico } } object { porta_copos translate <0,-10,0> texture { pigment { color White } } } } // Controle Remoto #declare controle_remoto = union { // controle remoto superellipsoid { <0.2, 0.3> scale <1, 2, .5> scale 2 texture { pretocr } } // botao de detonacao cylinder { <0,1,-1>, <0,1,-1.8>, 1 texture { vermelhobd } } // antena cylinder { <.7,2,0>, <.7,10,0>, .2 texture { metalico } } sphere { <.7,10,0>, .4 texture { metalico } } } object { bomba } object { controle_remoto scale .8 translate <10,-7,0> } plane { y, -10 pigment { checker color Black color White scale 5 } }