// Last edited on 2023-12-27 04:36:48 by stolfi // Moved Around by jevs background{ color rgb < 0, 0, 0 > } #declare tx_torso = texture{ pigment{ color rgb < 0.10, 0.80, 1.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_membro = texture{ pigment{ color rgb < 1.0, 1.0, 0.0 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_tronco = texture{ pigment{ color rgb < .55, 0.3, 0.08 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.950, 0.980, 0.900 >, color rgb < 0.900, 0.900, 0.900 > } finish{ diffuse 0.9 ambient 0.1 } scale 5.0 } #macro mao() #local hand = cylinder { <0, 0, 0>, <0, 0, 1>, 0.25 // center of one end, center of other end, radius } object{hand} #end #macro antebraco(D5) #local forearm = cylinder { <0, 0, 0>, <0, 0, 2>, 0.25 // center of one end, center of other end, radius } #local hand = object{ mao() rotate translate <0, 0, 2> } union{ object{forearm} object{hand} } #end #macro braco(M4, D5) #local arm = cylinder { <0, 0, 0>, <0, 0, 3>, 0.25 // center of one end, center of other end, radius } #local forearm = object{ antebraco(D5) rotate // translate <0, 0, 3> // } union { object{arm} object{forearm} } #end #macro membro(T1, T2, T3, M4, D5) #local arm = object{ braco(M4, D5) rotate // } object{ arm texture { tx_membro } } #end #macro cabeca(T1, T2, T3, M4) #end #macro robo( rMLTS1,rMLTS2,rMLTS3,rMLTF1,rMLTH1, rMRTS1,rMRTS2,rMRTS3,rMRTF1,rMRTH1, rMLBS1,rMLBS2,rMLBS3,rMLBF1,rMLBH1, rMRBS1,rMRBS2,rMRBS3,rMRBF1,rMRBH1, rHH1, rHH2, rHH3, rHN1 ) #local torso = box { <0, 0, 0>, <3, 2, 4> // near lower left corner, far upper right corner texture { tx_torso } } #local leftTop = object{ membro(rMLTS1,rMLTS2,rMLTS3,rMLTF1,rMLTH1) rotate<0,-90,0> } #local rightTop = object{ membro( rMRTS1,rMRTS2,rMRTS3,rMRTF1,rMRTH1) rotate<0,90,00> } #local leftBottom = object{ membro(rMLBS1,rMLBS2,rMLBS3,rMLBF1,rMLBH1) rotate <0, -90, 0> // } #local rightBottom = object{ membro(rMRBS1,rMRBS2,rMRBS3,rMRBF1,rMRBH1) rotate<0,90,0> } union { object{torso} object{leftTop translate <0, 1, 3>} object{rightTop rotate <180, 0, 0> translate <3, 1, 3> } object{leftBottom translate <0, 1, 1>} object{rightBottom rotate <180, 0, 0> translate <3, 1, 1> } } #end #declare raio = 2.000; #declare raioIni = 3; #macro empacota( xMLTS1,xMLTS2,xMLTS3,xMLTF1,xMLTH1, xMRTS1,xMRTS2,xMRTS3,xMRTF1,xMRTH1, xMLBS1,xMLBS2,xMLBS3,xMLBF1,xMLBH1, xMRBS1,xMRBS2,xMRBS3,xMRBF1,xMRBH1, xHH1, xHH2, xHH3, xHN1 ) #local P = array[NP] #local P[0] = xMLTS1; #local P[1] = xMLTS2; #local P[2] = xMLTS3; #local P[3] = xMLTF1; #local P[4] = xMLTH1; #local P[5] = xMRTS1; #local P[6] = xMRTS2; #local P[7] = xMRTS3; #local P[8] = xMRTF1; #local P[9] = xMRTH1; #local P[10] = xMLBS1; #local P[11] = xMLBS2; #local P[12] = xMLBS3; #local P[13] = xMLBF1; #local P[14] = xMLBH1; #local P[15] = xMRBS1; #local P[16] = xMRBS2; #local P[17] = xMRBS3; #local P[18] = xMRBF1; #local P[19] = xMRBH1; #local P[20] = xHH1; #local P[21] = xHH2; #local P[22] = xHH3; #local P[23] = xHN1; P #end #macro acha_quadro(tt, NQ, TQ) // #declare k = 0; // #if(tt = 0.0) // #local k = 0; // #end // // #if(tt = 0.250) // #local k = 1; // #end // // #if(tt = 0.500) // #local k = 2; // #end // // #if(tt = 0.650) // #local k = 3; // #end // // #if(tt = 1) // #local k = 4; // #end #local k = 0; // Prof #while((k < NQ) & (tt > TQ[k])) // Prof #local k = k + 1; // Prof #end // Prof k #end #macro interpola_quadro( tt, ta, Pa, tb, Pb, MLTS1,MLTS2,MLTS3,MLTF1,MLTH1, MRTS1,MRTS2,MRTS3,MRTF1,MRTH1, MLBS1,MLBS2,MLBS3,MLBF1,MLBH1, MRBS1,MRBS2,MRBS3,MRBF1,MRBH1, HH1, HH2, HH3, HN1 ) #local s = (tt - ta)/(tb - ta); #declare MLTS1 = (1-s)*Pa[1] + s * Pb[1]; #declare MLTS2 = (1-s)*Pa[2] + s * Pb[2]; #declare MLTS3 = (1-s)*Pa[3] + s * Pb[3]; #declare MLTF1 = (1-s)*Pa[4] + s * Pb[4]; #declare MLTH1 = (1-s)*Pa[5] + s * Pb[5]; #declare MRTS1 = (1-s)*Pa[6] + s * Pb[6]; #declare MRTS2 = (1-s)*Pa[7] + s * Pb[7]; #declare MRTS3 = (1-s)*Pa[8] + s * Pb[8]; #declare MRTF1 = (1-s)*Pa[9] + s * Pb[9]; #declare MRTH1 = (1-s)*Pa[10] + s * Pb[10]; #declare MLBS1 = (1-s)*Pa[11] + s * Pb[11]; #declare MLBS2 = (1-s)*Pa[12] + s * Pb[12]; #declare MLBS3 = (1-s)*Pa[13] + s * Pb[13]; #declare MLBF1 = (1-s)*Pa[14] + s * Pb[14]; #declare MLBH1 = (1-s)*Pa[15] + s * Pb[15]; #declare MRBS1 = (1-s)*Pa[16] + s * Pb[16]; #declare MRBS2 = (1-s)*Pa[17] + s * Pb[17]; #declare MRBS3 = (1-s)*Pa[18] + s * Pb[18]; #declare MRBF1 = (1-s)*Pa[19] + s * Pb[19]; #declare HH1 = (1-s)*Pa[20] + s * Pb[20]; #declare HH2 = (1-s)*Pa[21] + s * Pb[21]; #declare HH3 = (1-s)*Pa[22] + s * Pb[22]; #declare HN1 = (1-s)*Pa[23] + s * Pb[23]; #end #declare NP = 24; #include "galho.inc" #macro cena(tt) #local NQ = 6; #local TQ = array[NQ+1]; #local PQ = array[NQ+1]; #local TQ[0] = 0.000; #local PQ[0] = empacota( -80,0,0,-30,-60, 80,0,0,30,60, -80,0,0,-30,-60, 0,0,0,0,0, 0,0,0,0 ); #local TQ[1] = 0.000; #local PQ[1] = empacota( -80,0,0,-30,-60, 80,0,0,30,60, -80,0,0,-30,-60, 80,0,0,30,60, 0,0,0,0 ); #local TQ[2] = 0.000; #local PQ[2] = empacota( -80,0,0,-30,-60, 80,0,0,30,60, -80,0,0,-30,-60, 80,0,0,30,60, 0,0,0,0, ); #local TQ[3] = 0.000; #local PQ[3] = empacota( -80,0,0,-30,-60, 80,0,0,30,60, -80,0,0,-30,-60, 80,0,0,30,60, 0,0,0,0, ); #local TQ[4] = 0.000; #local PQ[4] = empacota( -80,0,0,-30,-60, 80,0,0,30,60, -80,0,0,-30,-60, 80,0,0,30,60, 0,0,0,0, ); #local TQ[5] = 0.000; #local PQ[5] = empacota( -80,0,0,-30,-60, 80,0,0,30,60, -80,0,0,-30,-60, 80,0,0,30,60, 0,0,0,0, ); #local TQ[6] = 1.000; #local PQ[6] = PQ[0] // Prof #local k = acha_quadro(tt, NQ, TQ); // Prof #local MLTS1 = 0; #local MLTS2 = 0; #local MLTS3 = 0; #local MLTF1 = 0; #local MLTH1 = 0; #local MRTS1 = 0; #local MRTS2 = 0; #local MRTS3 = 0; #local MRTF1 = 0; #local MRTH1 = 0; #local MLBS1 = 0; #local MLBS2 = 0; #local MLBS3 = 0; #local MLBF1 = 0; #local MLBH1 = 0; #local MRBS1 = 0; #local MRBS2 = 0; #local MRBS3 = 0; #local MRBF1 = 0; #local MRBH1 = 0; #local HH1 = 0; #local HH2 = 0; #local HH3 = 0; #local HN1 = 0; #local sloth = robo( -80,0,0,-30,-60, 80,0,0,30,60, -80,0,0,-30,-60, 80,0,0,30,60, 0,0,0,0, ) #local Lg = 4; // Deslocamento em 1 ciclo. -- Prof union{ object{ sloth rotate 90*x translate -1.5*x } object{ galho( < 0, -Lg/2, 0 >, < 0, +Lg/2, 0 >, 1, 0) translate 5*z } } #end #declare chao = disc { <0, 0, 0>, <0, 0, 1>, 200 texture { tx_xadrez } } object{ chao translate < 0,0,-5 > } #include "eixos.inc" // object{ eixos(10) } object{ cena(clock) } #include "camlight.inc" #declare centro_cena = < 0.00, -2.00, +4.00 >; #declare raio_cena = 8.0; #declare dir_camera = < 7, 5, 3 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)