// 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 < 14.00, 7.00, 6.00 > // 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, 3.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_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca1 = texture{ pigment{ color rgb < 1.00, 0.50, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } // ====================================================================== // DESCRIÇÃO DA CENA #declare raio = 2.000; // Partes da cena: #declare entrada = cylinder{ < 0.00, 0.00, 0.00 >, < 0.00, 0.00, +1.30 >, 0.40 } #declare furo = cylinder{ < 0.00, 0.00, 0.00 >, < 0.00, 0.00, +1.40 >, 0.35 } #declare corpo1 = cylinder{ < 0.00, 0.00, 0.00 >, < 0.00, 0.00, -0.80 >, 1.10 } #declare corpo2 = cylinder{ < 0.00, 0.00, -1.80 >, < 0.00, 0.00, -0.80 >, 1.10 } #declare saida = cylinder{ < 0.00, 0.00, 0.00 >, < +1.45, 0.00, 0.00 >, 0.30 } #declare saidainterna = cylinder{ < 0.00, 0.00, 0.00 >, < +1.50, 0.00, 0.00 >, 0.25 } #declare manivela1 = cylinder{ < 0.00, 0.00, 0.00 >, < 0.00, 1.40, 0.00 >, 0.12 } #declare manivela2 = cylinder{ < 0.00, 0.00, 0.00 >, < 0.00, 0.00, 1.10 >, 0.12 } #declare manivela3 = cylinder{ < 0.00, 0.00, 0.00 >, < 0.00, 0.70, 0.00 >, 0.12 } #declare encaixe1 = cylinder{ < 0.00, 0.00, 0.00 >, < 0.00, 0.20, 0.00 >, 0.17 } #declare encaixe2 = sphere{ < 0.00, 0.00, 0.00 >, 0.16 } #declare encaixe3 = sphere{ < 0.00, 0.00, 0.00 >, 0.16 } #declare caixa = box{ < 0.00, 0.00, 0.00 >, < 0.5, 0.7, 0.5 > } // sphere { , raio texture{tx_plastico}} // cylinder{ , rA, , rB } // cone { , rB} // box { , } // Aqui está a cena, finalmente: #declare cortador = box{ < -5, -5, -5 >, < 0.00, 5, 5 > } #declare cena = union{ object{ eixos(3.00) } difference{ object{ entrada texture {tx_fosca} } object{ furo texture {tx_plastico} } } difference{ difference{ union{ object{ corpo1 texture{ tx_plastico } } object{ corpo2 texture{ tx_fosca1 } } object{ saida translate < 0,0,-0.7 > texture{ tx_fosca } } } object{ saidainterna translate < 0,0,-0.7 > texture{ tx_plastico } } } object { caixa translate < 1.1,-0.4,-1.25 > texture{ tx_fosca1}} } object{ encaixe1 translate < 0,1,-0.6 > texture{ tx_fosca1 }} union{ object{ encaixe2 translate < 0,1.8,-0.6 > texture{ tx_fosca1 }} object{ manivela1 translate < 0,0.5,-0.6 > texture{ tx_fosca }} object{ manivela2 translate < 0,1.8,-0.6 > texture{ tx_fosca }} object{ encaixe3 translate < 0,1.8,0.4 > texture{ tx_fosca1 }} object{ manivela3 translate < 0,1.8,0.4 > texture{ tx_fosca }} } } union { object {cena translate < 0,0,5 >} intersection{ object {cena} object{cortador texture{ tx_fosca }} } }