// ====================================================================== // CORES E TEXTURAS background { color rgb < 0.75, 0.80, 0.85 > } // ====================================================================== // DESCRIÇÃO DA CENA #declare olho = union { sphere { <0, 0, 0>, 0.2 pigment { color rgb <1, 1, 1> } } sphere { <0, 0.12, 0>, 0.1 pigment { color rgb <0, 0, 0> } } } #declare orelha = difference { #local s = 0.55; sphere { <0, 0, s>, s scale <1, 0.3, 2> } sphere { <0, 0, s>, s scale <1, 0.3, 2> translate <0, s/4, 0> } } #declare pelo = cylinder { <0, 0, 0>, <1, 0, 0>, 0.01 } #declare narina = union { sphere { <0, 0, 0>, 0.3 } object { pelo rotate <0, -10, 0> } object { pelo rotate <0, 0, 0> } object { pelo rotate <0, +10, 0> } } #declare cabeca = union { sphere { <0, 0, 0>, 1 scale <1.1, 1, 1.2> } object { orelha translate <-0.8, 0, 0.6> } object { orelha translate < 0.8, 0, 0.6> } #local a = 40; object { olho rotate <-a, 0, -30> translate <0, 1, 0> rotate <+a, 0, +30> } object { olho rotate <-a, 0, +30> translate <0, 1, 0> rotate <+a, 0, -30> } sphere { narina rotate <10, 0, 30> scale <-1, 1, 1> translate <0, 1, 0> rotate <0, 0, +10> } sphere { narina rotate <10, 0, 30> translate <0, 1, 0> rotate <0, 0, -10> } pigment { color rgb <1, 1, 1> } } #declare relogio = union { difference { cylinder { <0, 0, 0>, <0, 0.2, 0>, 0.4 } cylinder { <0, -0.1, 0>, <0, 0.3, 0>, 0.3 } pigment { color rgb <0.2, 0.2, 1> } } cylinder { <0, 0, 0>, <0, 0, 0.1>, 0.2 translate <0, 0.1, 0.35> pigment {color rgb <0.6, 0.6, 0.6> } } } #macro pata(c) union { // Marca a origem sphere { <0, 0, 0>, 0.1 pigment { color rgb <1, 0, 0> } } union { difference { sphere { <0, 0, 0>, 0.4 scale <1, 1.3, 1> } box { <-1, -1, 0>, <1, 1, -1> } #local tr = 0.4 * sqrt(2)/2; translate <0, 1.3*tr, -tr> } rotate pigment { color rgb <1, 1, 1> } } } #end #macro ante(b, c, rel) union { cylinder { <0, 0, 0>, <0, 1, 0>, 0.3 pigment { color rgb <1, 1, 1> } } #if (rel = true) object { relogio translate <0, 0.7, 0> } #end sphere { <0, 1, 0>, 0.3 pigment { color rgb <1, 1, 1> } } object { pata(c) translate <0, 1.2, 0> } rotate } #end #macro ante_ante(a, b, c, rel) union { sphere { <0, 0, 0>, 0.3 pigment { color rgb <1, 1, 1> } } cylinder { <0, 0, 0>, <0, 0, -1>, 0.3 pigment { color rgb <1, 1, 1> } } sphere { <0, 0, -1>, 0.3 pigment { color rgb <1, 1, 1> } } object { ante(b, c, rel) translate <0, 0, -1> } rotate } #end #macro perna(a, b, c) object { ante_ante(a+150, b-200, c+90, false) } #end #macro braco(a, b, c, rel) object { ante_ante(a+90, b-90, c+45, rel) } #end #macro corpo(a1, b1, c1, a2, b2, c2, a3, b3, c3, a4, b4, c4) union { sphere { <0, 0, 0>, 1 } cylinder { <0, 0, 0>, <0, 0, -1>, 1 } sphere { <0, 0, -1>, 1 } object { braco(a1, b1, c1, true) rotate <0, -10, 0> translate <+1, 0, 0> } object { braco(a2, b2, c2, false) rotate <0, +10, 0> translate <-1, 0, 0> } object { perna(a3, b3, c3) rotate <0, 0, -25> translate <+1, 0, -1> } object { perna(a4, b4, c4) rotate <0, 0, +25> translate <-1, 0, -1> } object { rabo translate <0, -1, -1> } pigment { color rgb <1, 1, 1> } } #end #declare rabo = sphere { <0, 0, 0>, 0.3 pigment { color rgb <1, 1, 1> } } // a = ante-braco ou ante-perna // b = braco ou perna // c = pata // 1-2 = bracos esquerdo e direito // 3-4 = pernas esquerda e direita #macro coelho(a1, b1, c1, a2, b2, c2, a3, b3, c3, a4, b4, c4, cab) union { object { cabeca rotate <0, 0, cab> translate <0, 0.6, 1.5> } object { corpo(a1, b1, c1, a2, b2, c2, a3, b3, c3, a4, b4, c4) rotate <-45, 0, 0> } } #end #declare chao = box { <-20, -20, 0>, <20, 20, 0> pigment { image_map { jpeg "grama.jpg" } scale <5, 5, 1> } } union { object { chao translate <0, 0, -1.5> } object { coelho(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) translate <-1, -5, 0.5> } object { coelho(90, 0, 0, 50, 0, 0, 0, 0, 0, -20, 0, 20, 45) rotate <0, 0, -150> translate <-3, 2, 0.5> } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 6.0; #declare dir_camera = < 14.00, 7.00, 4.00 >; #declare dist_camera = 16.0; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)