// ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_gato = texture{ pigment{ color rgb < 0.92, 0.64, 0.51 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_relogio = texture{ pigment{ color rgb < 1.0, 1.0, 1.0 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } // ====================================================================== #macro boneco (oe, od, ce, cd, pe, pd, je, jd, ppe, ppd) union { corpo() object { braco (ce, 0) rotate< 0,oe,0 > translate < 1.1,0,0.8 > } object { braco (cd, 1) rotate< 0,od,0 > translate < 1.1,0,0.8 > scale <-1,1,1 > } object { perna (je,ppe) rotate< 0,pe,0 > translate < 0.3,0,-1.1 > } object { perna (jd,ppd) rotate< 0,pd,0 > translate < 0.3,0,-1.1 > scale <-1,1,1 > } } #end // Corpo e cabeca #macro corpo ( ) union{ object { sphere{ < 0,0,0 >, 0.8 } translate < 0,0,2.3 > texture{ tx_gato } } object { sphere{ < 0,0,0 >, 1.5 } translate < 0,0,0 > texture{ tx_gato } } } #end // Folhas (membros finais sem articulacao) #macro sub_braco ( relogio ) union{ object { sphere{ < 0,0,0 >, 0.25 } translate < 0,0,1.2 > texture{ tx_gato } } object { cylinder{ < 0, 0, 0 >, < 0, 0, 1.2 >, 0.18 } translate < 0,0,0 > texture{ tx_gato } } #if (relogio) object { cylinder{ < 0, 0, 0 >, < 0, 0, 0.2 >, 0.19 } translate < 0,0,0.7 > texture{ tx_relogio } } #end } #end #macro pe ( ) object { box{ < 0,0,0 >, < 1,0.5,0.3 > } translate < 0,-0.25, 0 > texture{ tx_gato } } #end // Demais membros #macro braco ( ang_c, relogio ) union{ object { cylinder{ < 0, 0, 0 >, < 0, 0, 1.2 >, 0.18 } translate < 0,0,0 > texture{ tx_gato } } object { sub_braco(relogio) rotate < ang_c,0,0 > translate < 0,0,1.2 > } } #end #macro sub_perna ( ang ) union{ object { cylinder{ < 0,0,0 >, < 0,0,1.2 >, 0.18 } translate < 0,0,-1.2 > texture{ tx_gato } } // object { pe() rotate < 0,ang,0 > translate < 0,0,-1.5 > } } #end #macro perna (ang_j, ang_p) union{ object { cylinder{ < 0, 0, 0 >, < 0, 0, 1.2 >, 0.18 } translate < 0,0,-1.2 > texture{ tx_gato } } object { sub_perna(ang_p) rotate < 0,ang_j,0 > translate < 0,0,-1.2 > } } #end #include "eixos.inc" // Aqui está a cena, finalmente: union{ object{ eixos(3.00) } // (oe, od, ce, cd, pe, pd, je, jd, ppe, ppd) object{ boneco(20,70,260,290,-20,-30,30,-30,0,0) translate < -2.5,0,0 > } object{ boneco(80,10,220,310,-30,0,30,-10,0,0) translate < 2.5,0,0 > } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 6.5; #declare dir_camera = < 14.00, 20.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)