/************************************************* * *** MC930 - COMPUTAÇÃO GRÁFICA *** * * Laboratório 2: Coroa de Arquimedes * Este projeto consiste no desenho da famosa coroa * que inspirou Arquimedes ao descobrir o empuxo. * * Autor: Volnei dos Santos (RA 010075) * 28/Set/2004 ************************************************/ // ====================================================================== // CÂMERA camera { location < 20.00, 00.00, 20.00> // Posição do observador. right -0.75*x // Largura RELATIVA da imagem. up 1.00*y // Altura RELATIVA da imagem. sky y // O céu fica no eixo z. look_at <0.00, 0.00, 0.00> // Câmera aponta para origem. } // ====================================================================== // FONTES DE LUZ light_source { 10 * <10.0, 10.0, 10.0> // Posição da lâmpada. color rgb 1.2 * < 1.00, 1.00, 1.00 > // Intensidade e cor da luz. } light_source { 10 * <0.0, -10.0, 0.0> // Posição da lâmpada. color rgb 1.8 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // DESCRIÇÃO DA CENA // Fundo da cena background{ color rgb <0.75, 0.80, 1.0> } // Tinta dourada #declare dourado = < 1.00, 1.00, 0.60>; // Tinta vermelha #declare vermelho = < 1.00, 0.00, 0.00>; // Textura de ouro #declare ouro = texture { pigment { rgb dourado } finish { ambient 0.05 diffuse 0.05 reflection dourado specular 0.2 roughness 0.05 } } // Textura de rubi #declare rubi = texture { pigment { rgb vermelho filter 1} finish { diffuse 0.1 specular 1 roughness 0.001 ambient 0.1 reflection 0.25 } } // Textura de vidro #declare vidro = texture { pigment { rgb <0.7,0.7,0.7> filter 1} finish { diffuse 0.1 specular 1 roughness 0.001 ambient 0.01 reflection 0.25 } } // Textura de pano #declare pano = texture { pigment { rgb <1, 0.6, 0.6> } finish { diffuse 0.05 } } // Textura da fita negra #declare negro = texture { pigment { color rgb < 0.00, 0.00, 0.00 > } finish { diffuse 0.1 specular 1 roughness 0.001 ambient 0.1 reflection 0.25 } } // Corpo da coroa #declare coroa = lathe { bezier_spline 8, <4.5, -1>, <6,0>, <5,1>, <4,2>, <4,2>, <3,3>, <8,5>, <4,10> texture { ouro } } // Joia preciosa, que será transladada para o lugar correto #declare joia = sphere { < 0.00, 0.00, 0.00 >, 0.5 texture { rubi } interior { ior 1.5 } } // As raias, que serão rotacionadas e transladadas #declare raias = box { < 5.00, 5.00, 5.00>, // Near lower left corner <-5.00,-5.00, -5.00> // Far upper right corner texture { ouro } rotate x*45 } // O enfeite superior #declare enfeite = torus { 4, 0.5 // major and minor radius texture { vidro } translate y*9.5 interior { ior 1.5 } } // A colcha para encaixar a cabeça #declare colcha = torus { 3.5, 1.50 // major and minor radius texture { pano } translate y*-0.5 } // A fita de enfeite #declare fita = torus { 3.75, 0.50 // major and minor radius texture { negro } translate y*2 } // ====================================================================== // Desenho da cena, utilizando as figuras definidas union { difference { object { coroa } object { raias translate 13*y} object { raias rotate y*90 translate 13*y} } object { enfeite } object { colcha } object { fita } object { joia translate 4.0*x translate 4.0*z translate 7*y } object { joia translate -4.0*x translate 4.0*z translate 7*y } object { joia translate 4.0*x translate -4.0*z translate 7*y } object { joia translate -4.0*x translate -4.0*z translate 7*y } } // Colocando um chão na cena plane { y, -5 pigment { checker color rgb <1.0, 1.0, 1.0> color rgb <0.0, 0.0, 0.0> scale 2 } }