// Last edited on 2011-02-17 01:04:59 by stolfilocal // Generic frame of a simple movie // (Tumbling spheres and cylinders) background{ color rgb < 0.75, 0.80, 0.85 > } // Um parâmetro que varia {+1, 00, -1, 00, +1}: #declare ctt = cos(2*pi*clock); // Um parâmetro que varia {00, +1, 00, -1, 00}: #declare stt = sin(2*pi*clock); // Um parâmetro que varia {00, +1, 00, +1, 00}: #declare stt2 = stt*stt; // Um parâmetro que varia {00, +1, 00}: #declare htt = 0.5*(1-ctt); // TINTAS #declare tinta_furo = texture { pigment { color rgb < 1.000, 0.800, 0.100 > } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare cor_bolona = (1-stt2)*< 1.000, 0.000, 0.000 > + stt2*< 1.000, 1.000, 0.000 >; #declare tinta_bolona = texture { pigment { color rgb cor_bolona } finish { diffuse 0.5 specular 0.5 roughness 0.005 ambient 0.1 } } #declare cor_pino = < 0.500, 0.500, 0.500 > + ctt*< 00.000, -0.083, +0.500 > + stt*< +0.500, -0.250, 00.000 >; #declare tinta_pino = texture { pigment { color rgb < 1.000, 0.800, 0.100 > } finish { diffuse 0.50 specular 0.50 roughness 0.005 ambient 0.10 } } #declare tinta_espelho = texture{ pigment{ color rgb < 1.000, 0.900, 0.700 > } finish{ diffuse 0.10 reflection 0.8*< 1.00, 0.90, 0.70 > ambient 0.10 } } #declare tinta_branca = texture{ pigment{ color rgb < 1.000, 1.000, 1.000 > } finish{ diffuse 0.70 specular 0.20 roughness 0.005 ambient 0.10 } } #declare tinta_cinza = texture{ pigment{ color rgb < 0.500, 0.500, 0.500 > } finish{ diffuse 0.70 specular 0.20 roughness 0.005 ambient 0.10 } } #declare tinta_vidro = texture{ pigment{ color rgb < 0.700, 0.900, 1.000 > filter 0.80 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tinta_luz_vermelha = texture{ pigment{ color rgb htt*< 1.000, 0.200, 0.150 > } finish{ diffuse 0.10 ambient 0.90 } } #declare tinta_luz_verde = texture{ pigment{ color rgb < 0.000, 1.000, 0.000 > } finish{ diffuse 0.10 ambient 0.90 } } #declare tinta_xadrez = texture{ pigment{ checker color rgb < 0.500, 0.850, 0.600 >, color rgb < 1.000, 0.980, 0.600 > } finish{ diffuse 0.90 ambient 0.10 } scale 3 } // BOLONA FURADA COM PINO #declare raio_bolona = 5.000; #declare bolona = sphere { < 0.00, 0.00, 0.00 >, raio_bolona texture { tinta_bolona } } #declare furo = cylinder { < -0.50, -1.00, -1.00 >, < +0.50, +1.00, +1.00 >, 0.15 + 0.65*stt*stt scale raio_bolona texture { tinta_furo } } #declare pino = cylinder { < -1.00, +1.00, -0.50 >, < +1.00, -1.00, +0.50 >, 0.25 + 0.15*stt scale raio_bolona texture { tinta_pino } } #declare bolona_completa = difference { union { object { bolona } object { pino } } object { furo } } // BOLINHA DE VIDRO #declare raio_bolinha = 0.30*raio_bolona; #declare bolinha = sphere{ < 0,0,0 >, raio_bolinha texture{ tinta_vidro } // Cor da superfície. interior { ior 1.25 } // Índice de refração interno. } // BOLOTA ESPELHADA OCA FURADA COM LUZ DENTRO #declare raio_bolota = 0.65*raio_bolona; #declare bolota = sphere{ < 0,0,0 >, raio_bolota texture{ tinta_espelho } } // CAIXA COM LUZES #declare raio_caixa = raio_bolona; #declare caixa = union{ difference{ box{ < -0.50, -0.50, 00.00 >, < +0.50, +0.50, +1.50 > texture{ tinta_cinza } } // Exterior union{ box{ < -0.40, -0.40, -0.10 >, < +0.40, +0.40, +1.40 > } // Espaco interior box{ < +0.30, -0.20, -0.10 >, < +0.60, +0.20, +0.80 > } // Buraco da porta box{ < -0.20, -0.30, +0.30 >, < +0.20, -0.60, +0.80 > } // Buraco da janela E box{ < -0.20, +0.30, +0.30 >, < +0.20, +0.60, +0.80 > } // Buraco da janela D texture{ tinta_branca } } } sphere{ < 0,0,0 >, 0.05 texture{ tinta_luz_verde } translate < +0.50, -0.20, +1.20 > } sphere{ < 0,0,0 >, 0.05 texture{ tinta_luz_vermelha } translate < +0.50, +0.20, +1.20 > } #declare pos_luz = (1-htt)*< -0.10, +0.20, +1.10 > + htt*< -0.05, -0.15, +0.95 >; object{ lamp_array(2,20,0.750) translate -1*x rotate 90*y translate pos_luz } scale raio_caixa } // CHÃO LADRILHADO #declare chao = plane{ z,0 texture{ tinta_xadrez } } // TUDO JUNTO #declare orbita_bolinha = 8.00; // Raio da órbita da bolinha. #declare orbita_bolota = 10.00; // Raio da órbita da bolota. #declare orbita_bolona = 3.00; // Raio da órbita da bolona. union{ union{ object{ bolona_completa } object{ bolinha translate orbita_bolinha*ctt*vnormalize(< 0.5, 1.0, 1.0 >) } rotate 360*clock*z translate -orbita_bolona*ctt*y } object{ bolota rotate clock*720*z translate orbita_bolota rotate clock*360*z rotate 30*y rotate 40*z } union{ object{ caixa translate < -6.00, -0.50, 00.00 >*orbita_bolota } object{ chao scale raio_bolona } translate -2*orbita_bolota*z } } #declare cam_ctr = < 0, 0, 0 >; // Para onde a camera deve olhar. #declare cam_rad = 25; // Raio da parte interessante da cena.