// Last edited on 2023-12-24 08:30:30 by stolfi #include "camlight.inc" #include "eixos.inc" #include "textures.inc" #include "objs.inc" #declare raio = 1.000; #declare PI = 3.14159; #declare space = 2.000; /////////////////// braco //////////////////// #macro braco(b3, b4) union { #local sub = object { antebraco(b4) } object{ toco } object{ sub rotate <0, b3, 0> translate <0, 0, 2> } } #end #macro antebraco(b4) union { #local sub = object { mao() } object{ toco } object{ sub rotate <0, b4, 0> translate <0, 0, 2> } } #end #macro mao() object{ palma } #end /////////////////// pescoco //////////////////// #macro pescoco(b3, b4) union { #local sub = object { nuca(b4) } object{ toco } object{ sub rotate translate <0, 0, 2> } } #end #macro nuca(b4) union { #local sub = object { m_cabeca() } object{ toco } object{ sub rotate <0, b4, 0> translate <0, 0, 2> } } #end #macro m_cabeca() object{ cabeca } #end // Partes da cena: // #declare chao = box{ <-50,-50,-1>, <+50,+50,0> } // object{ chao translate < -50,-50,-50 > texture{ tx_xadrez } } #declare DX = 6; #declare DY = 6; #declare DZ = 5; #macro bicho(b01, b02, b03, b04, b11, b12, b13, b14, b21, b22, b23, b24, b31, b32, b33, b34, p1, p2, p3, p4) union{ object { braco(b03, b04) rotate b02*y rotate b01*x translate < -2.0 , 2.00, 2.5 > } object { braco(b13, b14) rotate b12*y rotate b11*x scale <-1, 1, 1> translate < 2.0 , 2.00, 2.5 > } object { braco(b23, b24) rotate b22*y rotate b21*x translate < -2.0 , -2.00, 2.5 > } object { braco(b33, b34) rotate b32*y rotate b31*x scale <-1, 1, 1> translate < 2.0 , -2.00, 2.5 > } object { pescoco(p1, p2) rotate translate < 0.0 , 3.0, 2.5 > } object { corpo translate <0, 0, 2> } } #end union { object{ bicho(-10, 200, -10, -10, -10, 200, -10, -10, 10, 200, -10, -10, 10, 200, -10, -10, 40, 0, -90, 0) translate +DX*x } object{ bicho(+60, 230, -40, -80, +40, 210, -30, -60, -10, 240, -60, -70, -30, 220, -40, -90, 20, 30, -30, 40) translate -DX*x } // object { eixos(5) } } #declare cmin = < -2*DX, -DY, -DZ+3 >; #declare cmax = < +2*DX, +DY, +DZ+1 >; #include "gaiola.inc" // object{ gaiola(cmin,cmax) } #declare centro_cena = (cmin + cmax)/2; #declare raio_cena = 0.55*vlength(cmax-cmin); #declare dist_camera = 7*raio_cena; #declare dir_camera = < -5, 7, 3 >; #declare intens_luz = 1.0; camlight(centro_cena, raio_cena, dir_camera, dist_camera, z, intens_luz)