// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2009-03-09 18:44:03 by stolfi // ====================================================================== // CÂMERA camera{ location < 12.00, 10.00, 8.50 > // Posição do observador. right -0.45*x // Largura RELATIVA da imagem. up 0.60*y // Altura RELATIVA da imagem. sky z // Qual direção é "para cima"? look_at < 0.00, 0.00, 1.00 > // Para onde a câmera está apontando. } // Nota: os parâmetros "right" e "up" devem ter a mesma proporção // que os parâmetros ${WIDTH} e ${HEIGHT} no Makefile. // ====================================================================== // FONTES DE LUZ light_source{ 10 * < +50.0, +30.0, +50.0 > // Posição da lâmpada. color rgb 1.0 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } light_source{ 10 * < +50.0, -10.0, +10.0 > // Posição da lâmpada. color rgb 0.5 * < 1.00, 1.00, 1.00 > // Intensidade e corda luz. } // ====================================================================== // EIXOS DE COORDENADAS #macro eixo(ponta,cor,nome) union{ sphere{ <0,0,0>, 0.02 } cylinder{ <0,0,0>, 0.91*ponta, 0.02 } cone{ 0.90*ponta, 0.06, ponta, 0.00 } texture{ pigment{ color rgb cor } finish{ ambient 0.5 diffuse 0.5 } } } #end #macro eixos(tamanho) union{ object{ eixo( , <1.0,0.2,0.2>, "X") } object{ eixo( <0,tamanho,0>, <0.0,0.8,0.0>, "Y") } object{ eixo( <0,0,tamanho>, <0.3,0.3,1.0>, "Z") } } #end // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_plasticobr = texture{ pigment{ color rgb < 1.00, 1.00, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.90, 0.70 > } finish{ diffuse 0.1 reflection 0.8*< 1.00, 0.90, 0.70 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.97, 0.98, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } // ====================================================================== // DESCRIÇÃO DA CENA #declare raio = 2.000; // Partes da cena: #declare manivela1 = cylinder{ <1.00, 2.00, 1.50 >, <1.00, 2.50, 1.50 >, 0.10 texture{ tx_plastico } //texture{ tx_vidro } } #declare joelho12 = sphere{ <1.00, 2.50, 1.50 >, 0.10 texture{ tx_plastico } //texture{ tx_vidro } } #declare manivela2 = cylinder{ <1.00, 2.50, 1.50 >, <1.00, 2.50, 2.50 >, 0.10 texture{ tx_plastico } //texture{ tx_vidro } } #declare joelho23 = sphere{ <1.00, 2.50, 2.50 >, 0.10 texture{ tx_plastico } //texture{ tx_vidro } } #declare manivela3 = cylinder{ <1.00, 2.50, 2.50 >, <1.00, 3.30, 2.50 >, 0.10 texture{ tx_plastico } //texture{ tx_vidro } } #declare corpo = cylinder{ <1.00, 1.00, 0.00 >, <1.00, 1.00, 2.00 >, 1.00 texture{ tx_plastico } //texture{ tx_vidro } } #declare furo = cylinder{ < 1.00, 1.00, 0.10 >, < 1.00, 1.00, 2.10 >, 0.90 texture{ tx_plastico } //texture{ tx_vidro } } #declare pino = cylinder{ < 1.00, 1.00, 0.00 >, < 1.00, 1.00, 1.90 >, 0.20 texture{ tx_plastico } //texture{ tx_vidro } } #declare conecima = cone{ < 1.00, 1.00, 1.90 >, 0.50 < 1.00, 1.00, 2.50 >,0.0 texture{ tx_plasticobr } //texture{ tx_vidro } } #declare cortador = box{ <1.00, 0.00, 0.00 >, <-3.50, 3.50, 3.50 > //texture{ tx_plastico } texture{ tx_fosca } } // Aqui está a cena, finalmente: #declare manivela4= union{ object{ manivela1 } object{joelho12} object{ manivela2 } object{joelho23} object{ manivela3 } } #declare balde= difference{ object{ corpo } object{ furo } } #declare espremedor= union{ object{ balde } object{ pino } } #declare espremedor2= union{ object{ espremedor } object{ conecima } } #declare cena= union { object{espremedor2} object{manivela4} } union{ object{ eixos(3.00) } // object{cortador} //object{cena} intersection{ object{cena} object{cortador} //object{cena} } //object{ bolinha translate < 0,-3,4 > texture{ tx_plastico } } //object{ bolinha translate < 0,-1,4 > texture{ tx_fosca } } //object{ bolota translate < -2,+1,+3 > texture{ tx_espelho } } // object{ bolinha translate < +3,+3,+1 > texture{ tx_vidro } interior { ior 1.01 } } //object{ caixa translate < 0,-1,4 > texture{ tx_fosca } } scale 1.5 //rotate 90*2 }