// Trabalho prático 09 // ====================================================================== //Includes #include "eixos.inc" // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare tex = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } // ====================================================================== // DESCRIÇÃO DA CENA // ====================================================================== // Tamanhos padrão #declare legRadio = 0.1; #declare clawLen = 0.5; #declare tarsusLen = 1.5; #declare tibiaLen = 1.0; #declare femurLen = 0.7; #declare coxaLen = 0.7; // ====================================================================== // angulos perna 1 #declare P1 = array[4]; #declare P1[0] = 60; #declare P1[1] = -120; #declare P1[2] = -15; #declare P1[3] = 60; // ====================================================================== // angulos perna 2 #declare P2 = array[4]; #declare P2[0] = 60; #declare P2[1] = -120; #declare P2[2] = -15; #declare P2[3] = 60; #declare body = difference{ cylinder{ <-2,0,0>, <2,0,0>, 0.5 texture {tex} } box{ <-2.1,-0.5,0>, <2.1,0.5,-0.5> texture {tex} } } // ====================================================================== // Claw #declare Claw = union{ sphere{ <0,0,0>, legRadio texture {tex} } cylinder{ <0,legRadio,0>, <0,clawLen,0>, legRadio texture {tex} } } // ====================================================================== // Tarsus #macro Tarsus(d3) union{ sphere{ <0,0,0>, legRadio texture {tex} } cylinder{ <0,legRadio,0>, <0,tarsusLen,0>, legRadio texture {tex} } object{Claw rotate translate <0,legRadio+tarsusLen,0>} } #end // ====================================================================== // Tibia #macro Tibia(d2,d3) union{ sphere{ <0,0,0>, legRadio texture {tex} } cylinder{ <0,legRadio,0>, <0,tibiaLen,0>, legRadio texture {tex} } object{Tarsus(d3) rotate translate <0,legRadio+tibiaLen,0>} } #end // ====================================================================== // Femur #macro Femur(d1,d2,d3) union{ sphere{ <0,0,0>, legRadio texture {tex} } cylinder{ <0,legRadio,0>, <0,femurLen,0>, legRadio texture {tex} } object{Tibia(d2,d3) rotate translate <0,legRadio+femurLen,0>} } #end // ====================================================================== // Coxa #macro Coxa(d0,d1,d2,d3) union{ sphere{ <0,0,0>, legRadio texture {tex} } cylinder{ <0,legRadio,0>, <0,coxaLen,0>, legRadio texture {tex} } object{Femur(d1,d2,d3) rotate translate <0,legRadio+coxaLen,0>} } #end // ====================================================================== // Leg #macro Leg(d0,d1,d2,d3,d4) object{Coxa(d0,d1,d2,d3) rotate<0,0,d4>} #end // CENA object{ eixos(3.00) translate < 0,0,0 > } object{ eixos(1.0) } object{body translate <0,0,0.1>} //Parametrizavel individualmente, porem feito de forma simetrica para facilidade do trabalho #declare distLeg = 0.6; #declare angLeg = 30; object{Leg(P1[0],P1[1],P1[2],P1[3],angLeg) translate < -distLeg,0,0 > } object{Leg(P1[0],P1[1],P1[2],P1[3],0) translate < 0,0,0 > } object{Leg(P1[0],P1[1],P1[2],P1[3],-angLeg) translate < distLeg,0,0 > } object{Leg(P2[0],P2[1],P2[2],P2[3],angLeg) scale<1,-1,1> translate < -distLeg,0,0 > } object{Leg(P2[0],P2[1],P2[2],P2[3],0) scale<1,-1,1> translate < 0,0,0 > } object{Leg(P2[0],P2[1],P2[2],P2[3],-angLeg) scale<1,-1,1> translate < distLeg,0,0 > } // ILUMINACAO E CAMERA #include "camlight.inc" #declare centro_cena = < 0, 0, 0>; #declare raio_cena = 5.0; #declare dir_camera = < 10, -5, 5 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)