// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2022-01-06 02:03:33 by stolfi // ====================================================================== // CORES E TEXTURAS #declare roleta = seed(167494); background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_plastico = 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_fosca = texture{ pigment{ color rgb < 1.00, 0.80, 0.10 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_black = texture{ pigment{ color rgb < 0.40, 0.40, 0.40 > } finish{ diffuse 1.0 ambient 0.0 } } #declare tx_gray = texture{ pigment{ color rgb < 0.20, 0.20, 0.20 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_white = texture{ pigment{ color rgb < 1.00, 1.00, 1.00 > } finish{ diffuse 0.9 ambient 0.1 } } #local tx_coke = texture{ pigment{ color rgb < 1, 0, 0 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 0.85, 0.30 > ambient 0.1 } } #declare tx_coke_2 = texture{ pigment{ color rgb < 0.58, 0.29, 0.00 > } normal { bumps 0.75 scale <0.025,0.075,0.025> } finish { diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_brown = texture{ pigment{ color rgb < 0.9, 0.00, 0.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_green = texture{ pigment{ color rgb < 0.0, 0.5, 0.00 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_espelho = texture{ pigment{ color rgb < 1.00, 0.85, 0.30 > } finish{ diffuse 0.2 reflection 0.7*< 1.00, 0.85, 0.30 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 0.85, 0.95, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_vidro_green = texture{ pigment{ color rgb < 0.05, 0.90, 0.00 > filter 0.70 } finish{ diffuse 0.33 reflection 0.05 ambient 0.02 specular 0.25 roughness 0.005 } } #declare tx_xadrez = texture{ pigment{ checker color rgb < 0.10, 0.32, 0.60 >, color rgb < 1.00, 0.97, 0.90 > } finish{ diffuse 0.9 ambient 0.1 } scale 2.0 } // ====================================================================== // DESCRI��O DA CENA #declare raio = 2.000; // Partes da cena: #declare bolinha = sphere{ < 0,0,0 >, 0.50 } #declare bolota = sphere{ < 0,0,0 >, 1.50 } #declare bola = sphere{ < 0.00, 0.00, 0.00 >, raio texture{ tx_plastico } } #declare pino = cylinder{ < -2.00, +2.00, -1.00 >, < +2.00, -2.00, +1.00 >, 0.75 texture{ tx_fosca } } #declare furo = cylinder{ < -1.00, -2.00, -2.00 >, < +1.00, +2.00, +2.00 >, 0.75*raio texture{ tx_fosca } } #declare chao = box{ <-20,-20,-1>, <+20,+20,0> texture { tx_green }} #declare ovniBody = cylinder{ < 0.00, 0.00, 0.00 >, < 0.00, 2.00, 0.00 >, 0.5 texture{ tx_xadrez } } #declare ovniHead = cone{ < 0, 0, 0 >, 0.5, < 0, 1, 0 >, 0 texture{ tx_xadrez } } #declare ovniBox = box{ <0, 0, 0>, <1, 1, 1> texture {tx_fosca} } #declare ovniHole = cylinder { <0, 0, 0>, <0, 2, 0>, 0.25 texture { tx_coke } } // ///////////// #include "eixos.inc" // Aqui est� a cena, finalmente: #declare ovni = union { object { bolinha translate <0, -4.5, 0>texture{ tx_coke } } object { bolinha translate <0, -3.5, 0> texture{ tx_fosca } } object { bolinha translate <0, -2.5, 0> texture{ tx_coke } } object { bolinha translate <0, -1.5, 0> texture{ tx_fosca } } object { bolinha translate <0, -0.5, 0> texture{ tx_coke } } object { ovniBody } object { ovniHead translate <0, 2, 0> } difference { object { ovniBox translate <-0.5, +3.0, -0.5> } object { ovniHole translate <0, 2.5, 0> } } } #macro soldier(fullTexture) #local soldierHead = sphere{ <0, 0, 0>, 0.25 translate <0, 0, 1> } #local soldierBody = box { <0, 0, 0>, <0.2, 0.2, 1> translate <-0.1, -0.1, 0.2> } #local soldierBase = box { <0, 0, 0>, <0.5, 0.5, 0.2> translate <-0.25, -0.25, 0> } union { object { soldierHead texture { fullTexture } } object { soldierBody texture { fullTexture } } object { soldierBase texture { fullTexture } } } #end #macro ship(fullTexture) #local shipMiddle = sphere{ <0, 0, 0>, 0.4 translate <0, 0, 0> } #local shipHead = sphere{ <0, 0, 0>, 0.3 translate <0, 0.7, 0> } #local shipTail = sphere{ <0, 0, 0>, 0.4 translate <0, -0.8, 0> } union { object { shipMiddle texture { fullTexture } } object { shipHead texture { fullTexture } } object { shipTail texture { fullTexture } } } #end #macro generateArmy(soldierRows, soldierColumns) union { #local soldierRowsCounter = 0; #while (soldierRowsCounter < soldierRows) #local soldierColumnsCounter = 0; #while (soldierColumnsCounter < soldierColumns) #local kk = (soldierColumnsCounter) * (soldierRowsCounter + 1); #if (sin(15*kk*kk) > -0.2) object { soldier(tx_fosca) translate <2 * soldierRowsCounter, 1.2 * soldierColumnsCounter, 0> } #end #local soldierColumnsCounter = soldierColumnsCounter + 1; #end #local soldierRowsCounter = soldierRowsCounter + 1; #end } #end #macro generateShipArmy(shipRows, shipColumns) union { #local shipRowsCounter = 0; #while (shipRowsCounter < shipRows) #local shipColumnsCounter = 0; #while (shipColumnsCounter < shipColumns) #local kk = (shipColumnsCounter + 1) * (shipRowsCounter + 5); #if (sin(15*kk*kk) > 0) object { ship(tx_coke_2) translate <3 * shipRowsCounter, 2.5 * shipColumnsCounter, 0> scale <0.5, 0.5, 0.5> } #end #local shipColumnsCounter = shipColumnsCounter + 1; #end #local shipRowsCounter = shipRowsCounter + 1; #end } #end #macro randomNegative() #local value = 1; #if (rand(roleta) < 0.5) #local value = 1; #else #local value = -1; #end value #end #macro generateTree(leaves) union { object { cylinder { <0, 0, 0>, <0, 0, 1>, 0.2 texture { tx_coke_2 } } } object { sphere{ <0, 0, 0>, 0.2 translate <0, 0, 1> texture { tx_coke_2 } } } #if (leaves) object { sphere { <0, 0, 0>, 0.4 translate <0, 0, 1> texture { tx_green } }} #end } #end #macro arvore(P, A, K, S) #if (A < 1) union { object { generateTree(true) translate P } } // return #else #if (K < 1) union { object { generateTree(true) translate P } } #else union { object { generateTree(false) } #if (rand(roleta) < 0.9) #local newS = S - 0.05; #local NL = <0, 0, 0>; #local la = rand(roleta) * 40 * randomNegative(); #local lb = rand(roleta) * 40 * randomNegative(); #local lc = rand(roleta) * 40 * randomNegative(); object { arvore(NL, A - 1, K - 1, newS) rotate scale translate <0, 0, 1> } #end #if (rand(roleta) < 0.9) #local newS = S - 0.02; #local NL = <0, 0, 0>; #local ra = rand(roleta) * -40 * randomNegative(); #local rb = rand(roleta) * -40 * randomNegative(); #local rc = rand(roleta) * -40 * randomNegative(); object { arvore(NL, A - 1, K - 1, newS) rotate scale translate <0, 0, 1> } #end translate P } #end #end #end #macro plantacao(M, N, A, K) union { #local counterM = 0; #while (counterM < M) #local counterN = 0; #while (counterN < N) #local xx = counterM * 5; #local yy = counterN * 5; #local zz = 0; #local xxx = xx + (rand(roleta) * 1.5) * randomNegative(); #local yyy = yy + (rand(roleta) * 1.5) * randomNegative(); #local place = ; object { arvore(place, A, K, 1) } #local counterN = counterN + 1; #end #local counterM = counterM + 1; #end } #end // content from another year files #macro interpolNumber(t0, v0, t1, v1, tt) #local r = (tt - t0) / (t1 - t0); #local s = 1 - r; #local vv = s * v0 + r * v1; vv #end // returns a point #macro interpol(t0, v0, t1, v1, tt) #local r = (tt - t0) / (t1 - t0); #local s = 1 - r; #local vv = s * v0 + r * v1; #local returnX = s * v0.x + r * v1.x; #local returnY = s * v0.y + r * v1.y; #local returnZ = s * v0.z + r * v1.z; #end #macro bezierArc(t0, t1, A, B, C, D, tt) #local AB = interpol(t0, A, t1, B, tt); #local BC = interpol(t0, B, t1, C, tt); #local CD = interpol(t0, C, t1, D, tt); #local ABC = interpol(t0, AB, t1, BC, tt); #local BCD = interpol(t0, BC, t1, CD, tt); #local ABCD = interpol(t0, ABC, t1, BCD, tt); ABCD #end #macro interpola_quadros(NP, NA, Q, k0, t0, k1, t1, tt, A) #for(i, 0, NP - 1, 1) #for(j, 0, NA - 1, 1) #local A[i][j] = interpolNumber(t0, Q[k0][i][j], t1, Q[k1][i][j], tt); #end #end #end #macro busca_tempo(clk, NQ, tk) #local valueToBeReturned = 0; #for (i, 0, NQ - 1, 1) #local valorDoQuadroChave = tk[i]; #if (clk > valorDoQuadroChave) #local valueToBeReturned = i; #end #end valueToBeReturned #end // constants.inc #declare NK = 6; #declare NP = 6; #declare NA = 4; // ARRAY OF FRAME TIMES #declare tk = array[NK]; #declare tk[0] = 0/5; #declare tk[1] = 1/5; #declare tk[2] = 2/5; #declare tk[3] = 3/5; #declare tk[4] = 4/5; #declare tk[5] = 5/5; // POV RAY OBLIGATES US TO INITIALIZE R AND ITS CONTENT BEFORE PASSING IT TO FUNCTION interpola_quadros #declare A = array[NP][NA]; #for (i, 0, NP - 1, 1) #for(j, 0, NA - 1, 1) #declare A[i][j] = 0; #end #end // frames matrix #declare Q = array[NK][NP][NA]; // ====================================================================================================================================== // quadro 0 FAKE // #declare numeroDoQuadroMatrizQ = 0; // #declare Q[numeroDoQuadroMatrizQ][0][0] = 0; // #declare Q[numeroDoQuadroMatrizQ][0][1] = 20; // #declare Q[numeroDoQuadroMatrizQ][0][2] = 95; // #declare Q[numeroDoQuadroMatrizQ][0][3] = 20; // #declare Q[numeroDoQuadroMatrizQ][1][0] = 40; // #declare Q[numeroDoQuadroMatrizQ][1][1] = 270; // #declare Q[numeroDoQuadroMatrizQ][1][2] = 20; // #declare Q[numeroDoQuadroMatrizQ][1][3] = 30; // #declare Q[numeroDoQuadroMatrizQ][2][0] = 0; // #declare Q[numeroDoQuadroMatrizQ][2][1] = 40; // #declare Q[numeroDoQuadroMatrizQ][2][2] = 0; // #declare Q[numeroDoQuadroMatrizQ][2][3] = 270; // #declare Q[numeroDoQuadroMatrizQ][3][0] = 0; // #declare Q[numeroDoQuadroMatrizQ][3][1] = 20; // #declare Q[numeroDoQuadroMatrizQ][3][2] = 330; // #declare Q[numeroDoQuadroMatrizQ][3][3] = 20; // #declare Q[numeroDoQuadroMatrizQ][4][0] = 0; // #declare Q[numeroDoQuadroMatrizQ][4][1] = 0; // #declare Q[numeroDoQuadroMatrizQ][4][2] = 90; // #declare Q[numeroDoQuadroMatrizQ][4][3] = 0; // #declare Q[numeroDoQuadroMatrizQ][5][0] = 0; // #declare Q[numeroDoQuadroMatrizQ][5][1] = 0; // #declare Q[numeroDoQuadroMatrizQ][5][2] = 90; // #declare Q[numeroDoQuadroMatrizQ][5][3] = 0; // ====================================================================================================================================== // quadro 0 #declare numeroDoQuadroMatrizQ = 0; #declare Q[numeroDoQuadroMatrizQ][0][0] = 270; #declare Q[numeroDoQuadroMatrizQ][0][1] = 90; #declare Q[numeroDoQuadroMatrizQ][0][2] = 80; #declare Q[numeroDoQuadroMatrizQ][0][3] = 30; #declare Q[numeroDoQuadroMatrizQ][1][0] = 260; #declare Q[numeroDoQuadroMatrizQ][1][1] = 70; #declare Q[numeroDoQuadroMatrizQ][1][2] = 70; #declare Q[numeroDoQuadroMatrizQ][1][3] = 290; #declare Q[numeroDoQuadroMatrizQ][2][0] = 250; #declare Q[numeroDoQuadroMatrizQ][2][1] = 100; #declare Q[numeroDoQuadroMatrizQ][2][2] = 79; #declare Q[numeroDoQuadroMatrizQ][2][3] = 310; #declare Q[numeroDoQuadroMatrizQ][3][0] = 240; #declare Q[numeroDoQuadroMatrizQ][3][1] = 83; #declare Q[numeroDoQuadroMatrizQ][3][2] = 99; #declare Q[numeroDoQuadroMatrizQ][3][3] = 290; #declare Q[numeroDoQuadroMatrizQ][4][0] = 20; #declare Q[numeroDoQuadroMatrizQ][4][1] = 80; #declare Q[numeroDoQuadroMatrizQ][4][2] = 70; #declare Q[numeroDoQuadroMatrizQ][4][3] = 320; #declare Q[numeroDoQuadroMatrizQ][5][0] = 90; #declare Q[numeroDoQuadroMatrizQ][5][1] = 270; #declare Q[numeroDoQuadroMatrizQ][5][2] = 140; #declare Q[numeroDoQuadroMatrizQ][5][3] = 40; // ====================================================================================================================================== // quadro 1 #declare numeroDoQuadroMatrizQ = 1; #declare Q[numeroDoQuadroMatrizQ][0][0] = 270; #declare Q[numeroDoQuadroMatrizQ][0][1] = 90; #declare Q[numeroDoQuadroMatrizQ][0][2] = 80; #declare Q[numeroDoQuadroMatrizQ][0][3] = 30; #declare Q[numeroDoQuadroMatrizQ][1][0] = 260; #declare Q[numeroDoQuadroMatrizQ][1][1] = 70; #declare Q[numeroDoQuadroMatrizQ][1][2] = 70; #declare Q[numeroDoQuadroMatrizQ][1][3] = 290; #declare Q[numeroDoQuadroMatrizQ][2][0] = 250; #declare Q[numeroDoQuadroMatrizQ][2][1] = 100; #declare Q[numeroDoQuadroMatrizQ][2][2] = 79; #declare Q[numeroDoQuadroMatrizQ][2][3] = 310; #declare Q[numeroDoQuadroMatrizQ][3][0] = 240; #declare Q[numeroDoQuadroMatrizQ][3][1] = 83; #declare Q[numeroDoQuadroMatrizQ][3][2] = 99; #declare Q[numeroDoQuadroMatrizQ][3][3] = 290; #declare Q[numeroDoQuadroMatrizQ][4][0] = 0; #declare Q[numeroDoQuadroMatrizQ][4][1] = 0; #declare Q[numeroDoQuadroMatrizQ][4][2] = 0; #declare Q[numeroDoQuadroMatrizQ][4][3] = 0; #declare Q[numeroDoQuadroMatrizQ][5][0] = 0; #declare Q[numeroDoQuadroMatrizQ][5][1] = 0; #declare Q[numeroDoQuadroMatrizQ][5][2] = 0; #declare Q[numeroDoQuadroMatrizQ][5][3] = 0; // ====================================================================================================================================== // quadro 2 #declare numeroDoQuadroMatrizQ = 2; #declare Q[numeroDoQuadroMatrizQ][0][0] = 0; #declare Q[numeroDoQuadroMatrizQ][0][1] = 0; #declare Q[numeroDoQuadroMatrizQ][0][2] = 0; #declare Q[numeroDoQuadroMatrizQ][0][3] = 0; #declare Q[numeroDoQuadroMatrizQ][1][0] = 0; #declare Q[numeroDoQuadroMatrizQ][1][1] = 0; #declare Q[numeroDoQuadroMatrizQ][1][2] = 0; #declare Q[numeroDoQuadroMatrizQ][1][3] = 0; #declare Q[numeroDoQuadroMatrizQ][2][0] = 0; #declare Q[numeroDoQuadroMatrizQ][2][1] = 0; #declare Q[numeroDoQuadroMatrizQ][2][2] = 0; #declare Q[numeroDoQuadroMatrizQ][2][3] = 0; #declare Q[numeroDoQuadroMatrizQ][3][0] = 0; #declare Q[numeroDoQuadroMatrizQ][3][1] = 0; #declare Q[numeroDoQuadroMatrizQ][3][2] = 0; #declare Q[numeroDoQuadroMatrizQ][3][3] = 0; #declare Q[numeroDoQuadroMatrizQ][4][0] = 0; #declare Q[numeroDoQuadroMatrizQ][4][1] = 0; #declare Q[numeroDoQuadroMatrizQ][4][2] = 0; #declare Q[numeroDoQuadroMatrizQ][4][3] = 0; #declare Q[numeroDoQuadroMatrizQ][5][0] = 0; #declare Q[numeroDoQuadroMatrizQ][5][1] = 0; #declare Q[numeroDoQuadroMatrizQ][5][2] = 0; #declare Q[numeroDoQuadroMatrizQ][5][3] = 0; // ====================================================================================================================================== // quadro 3 #declare numeroDoQuadroMatrizQ = 3; #declare Q[numeroDoQuadroMatrizQ][0][0] = 0; #declare Q[numeroDoQuadroMatrizQ][0][1] = 0; #declare Q[numeroDoQuadroMatrizQ][0][2] = 0; #declare Q[numeroDoQuadroMatrizQ][0][3] = 0; #declare Q[numeroDoQuadroMatrizQ][1][0] = 0; #declare Q[numeroDoQuadroMatrizQ][1][1] = 0; #declare Q[numeroDoQuadroMatrizQ][1][2] = 0; #declare Q[numeroDoQuadroMatrizQ][1][3] = 0; #declare Q[numeroDoQuadroMatrizQ][2][0] = 0; #declare Q[numeroDoQuadroMatrizQ][2][1] = 0; #declare Q[numeroDoQuadroMatrizQ][2][2] = 0; #declare Q[numeroDoQuadroMatrizQ][2][3] = 0; #declare Q[numeroDoQuadroMatrizQ][3][0] = 0; #declare Q[numeroDoQuadroMatrizQ][3][1] = 0; #declare Q[numeroDoQuadroMatrizQ][3][2] = 0; #declare Q[numeroDoQuadroMatrizQ][3][3] = 0; #declare Q[numeroDoQuadroMatrizQ][4][0] = 0; #declare Q[numeroDoQuadroMatrizQ][4][1] = 0; #declare Q[numeroDoQuadroMatrizQ][4][2] = 90; #declare Q[numeroDoQuadroMatrizQ][4][3] = 0; #declare Q[numeroDoQuadroMatrizQ][5][0] = 0; #declare Q[numeroDoQuadroMatrizQ][5][1] = 0; #declare Q[numeroDoQuadroMatrizQ][5][2] = 90; #declare Q[numeroDoQuadroMatrizQ][5][3] = 0; // ====================================================================================================================================== // quadro 4 #declare numeroDoQuadroMatrizQ = 4; #declare Q[numeroDoQuadroMatrizQ][0][0] = 0; #declare Q[numeroDoQuadroMatrizQ][0][1] = 20; #declare Q[numeroDoQuadroMatrizQ][0][2] = 95; #declare Q[numeroDoQuadroMatrizQ][0][3] = 20; #declare Q[numeroDoQuadroMatrizQ][1][0] = 40; #declare Q[numeroDoQuadroMatrizQ][1][1] = 270; #declare Q[numeroDoQuadroMatrizQ][1][2] = 20; #declare Q[numeroDoQuadroMatrizQ][1][3] = 30; #declare Q[numeroDoQuadroMatrizQ][2][0] = 0; #declare Q[numeroDoQuadroMatrizQ][2][1] = 40; #declare Q[numeroDoQuadroMatrizQ][2][2] = 0; #declare Q[numeroDoQuadroMatrizQ][2][3] = 270; #declare Q[numeroDoQuadroMatrizQ][3][0] = 0; #declare Q[numeroDoQuadroMatrizQ][3][1] = 20; #declare Q[numeroDoQuadroMatrizQ][3][2] = 330; #declare Q[numeroDoQuadroMatrizQ][3][3] = 20; #declare Q[numeroDoQuadroMatrizQ][4][0] = 0; #declare Q[numeroDoQuadroMatrizQ][4][1] = 0; #declare Q[numeroDoQuadroMatrizQ][4][2] = 90; #declare Q[numeroDoQuadroMatrizQ][4][3] = 0; #declare Q[numeroDoQuadroMatrizQ][5][0] = 0; #declare Q[numeroDoQuadroMatrizQ][5][1] = 0; #declare Q[numeroDoQuadroMatrizQ][5][2] = 90; #declare Q[numeroDoQuadroMatrizQ][5][3] = 0; // ====================================================================================================================================== // quadro 5 #declare numeroDoQuadroMatrizQ = 5; #declare Q[numeroDoQuadroMatrizQ][0][0] = 270; #declare Q[numeroDoQuadroMatrizQ][0][1] = 50; #declare Q[numeroDoQuadroMatrizQ][0][2] = 80; #declare Q[numeroDoQuadroMatrizQ][0][3] = 30; #declare Q[numeroDoQuadroMatrizQ][1][0] = 260; #declare Q[numeroDoQuadroMatrizQ][1][1] = 70; #declare Q[numeroDoQuadroMatrizQ][1][2] = 70; #declare Q[numeroDoQuadroMatrizQ][1][3] = 290; #declare Q[numeroDoQuadroMatrizQ][2][0] = 250; #declare Q[numeroDoQuadroMatrizQ][2][1] = 100; #declare Q[numeroDoQuadroMatrizQ][2][2] = 79; #declare Q[numeroDoQuadroMatrizQ][2][3] = 310; #declare Q[numeroDoQuadroMatrizQ][3][0] = 240; #declare Q[numeroDoQuadroMatrizQ][3][1] = 83; #declare Q[numeroDoQuadroMatrizQ][3][2] = 99; #declare Q[numeroDoQuadroMatrizQ][3][3] = 290; #declare Q[numeroDoQuadroMatrizQ][4][0] = 20; #declare Q[numeroDoQuadroMatrizQ][4][1] = 80; #declare Q[numeroDoQuadroMatrizQ][4][2] = 70; #declare Q[numeroDoQuadroMatrizQ][4][3] = 320; #declare Q[numeroDoQuadroMatrizQ][5][0] = 90; #declare Q[numeroDoQuadroMatrizQ][5][1] = 270; #declare Q[numeroDoQuadroMatrizQ][5][2] = 140; #declare Q[numeroDoQuadroMatrizQ][5][3] = 40; #macro braco1() union { object { sphere { < 0.00, 0.00, 0.00 >, 0.4 texture{ tx_black } } } object { box { <-0.1, 0.1, -0.1>, <0.1, 2.1, 0.1> texture { tx_brown } } } } #end #macro braco2(angleX1) union { object { sphere { < 0.00, 0.00, 0.00 >, 0.4 texture{ tx_black } } } object { box { <-0.2, 0.2, -0.2>, <0.2, 3.2, 0.2> texture { tx_plastico } } } object { braco1() rotate translate <0, 3, 0> } } #end #macro perna1() union { object { sphere { < 0.00, 0.00, 0.00 >, 0.4 texture{ tx_brown } } } object { box { <-0.2, 0.2, -0.2>, <0.2, 2.2, 0.2> texture { tx_black } } } } #end #macro perna2(angleX1, angleY1) union { object { sphere { < 0.00, 0.00, 0.00 >, 0.4 texture{ tx_brown } } } object { box { <-0.3, 0.3, -0.3>, <0.3, 2.3, 0.3> texture { tx_coke_2 } } } object { perna1() rotate translate <0, 2, 0> } } #end #macro perna3(angleX2, angleY2, angleX1, angleY1) union { object { sphere { < 0.00, 0.00, 0.00 >, 0.4 texture{ tx_brown } } } object { box { <-0.25, 0.25, -0.25>, <0.25, 2.25, 0.25> texture { tx_green } } } object { perna2(angleX1, angleY1) rotate translate <0, 2, 0> } } #end #macro robo(bracoDireitoX, bracoDireitoY, bracoDireitoZ, bracoDireito1X, bracoEsquerdoX, bracoEsquerdoY, bracoEsquerdoZ, bracoEsquerdo1X, pd1, pd2, pd3, pd4, pdrX, pdrY, pdrZ, pe1, pe2, pe3, pe4, perX, perY, perZ) union { // head difference { object { box { <-0.5, -0.5, -0.5>, <0.5, 0.5, 0.5> texture { tx_coke_2 } } translate <0, 0, 0> } object { box { <-5, -0.15, -0.15>, <5, 0.15, 0.15> texture { tx_coke_2 } } translate <0, 0.25, 0.1> } object { box { <-5, -0.15, -0.15>, <5, 0.15, 0.15> texture { tx_coke_2 } } translate <0, 0.25, 0.1> scale <1, -1, 1> } object { box { <-5, -0.4, -0.15>, <5, 0.4, 0.15> texture { tx_coke_2 } } translate <0, 0.0, -0.3> } } object { braco2(bracoDireito1X) rotate } object { braco2(bracoEsquerdo1X) rotate scale <1, -1, 1> } object { perna3(pd1, pd2, pd3, pd4) rotate translate <0, 0.35, 0> } object { perna3(pe1, pe2, pe3, pe4) rotate translate <0, 0.35, 0> scale <1, -1, 1> } } #end #macro robo_matrix(am) object { robo(am[0][0], am[0][1], am[0][2], am[0][3], am[1][0], am[1][1], am[1][2], am[1][3], am[2][0], am[2][1], am[2][2], am[2][3], am[3][0], am[3][1], am[3][2], am[3][3], am[4][0], am[4][1], am[4][2], am[4][3], am[5][0], am[5][1]) } // union { // #local aAngle = 300; // #local bAngle = 80; // #local cAngle = 90; // #local dAngle = 270; // object { box { <0, 0, 0>, <1.0, 1.0, 1.0> texture { tx_fosca_black } } } // object { perna(anglesMatrix[0][0], anglesMatrix[0][1], anglesMatrix[0][2], anglesMatrix[0][3]) rotate <315, 0, 0> translate <1, 1, 0>} // object { perna(anglesMatrix[1][0], anglesMatrix[1][1], anglesMatrix[1][2], anglesMatrix[1][3]) rotate <315, 0, 0> scale <1, -1, 1> translate <1, 0, 0>} // object { perna(anglesMatrix[2][0], anglesMatrix[2][1], anglesMatrix[2][2], anglesMatrix[2][3]) rotate <315, 0, 270> translate <1, 0.5, 0>} // object { perna(anglesMatrix[3][0], anglesMatrix[3][1], anglesMatrix[3][2], anglesMatrix[3][3]) rotate <315, 0, 270> scale <-1, 1, 1> translate <0, 0.5, 0>} // object { perna(anglesMatrix[4][0], anglesMatrix[4][1], anglesMatrix[4][2], anglesMatrix[4][3]) rotate <345, 0, 0> translate <0.5, 1, 0.5>} // object { perna(anglesMatrix[5][0], anglesMatrix[5][1], anglesMatrix[5][2], anglesMatrix[5][3]) rotate <345, 0, 0> scale <1, -1, 1> translate <0.5, 0, 0.5>} // } #end #macro quadro(clk) #local frameIndex = busca_tempo(clock, NK, tk); interpola_quadros(NP, NA, Q, frameIndex, tk[frameIndex], frameIndex + 1, tk[frameIndex + 1], clock, A) // object { inseto(A) } object { robo_matrix(A) } #end union{ // object { eixos(3.00) } // object { chao translate <8, 8, 0> } #local pd1 = 90; #local pd2 = 20; #local pd3 = 25; #local pd4 = 20; #local pdrX = 0; #local pdrY = 0; #local pdrZ = 0; #local pe1 = 0; #local pe2 = 0; #local pe3 = 0; #local pe4 = 0; #local perX = 0; #local perY = 0; #local perZ = 0; // object { // robo(0, 0, 0, 45, 0, -30, 0, -45, pd1, pd2, pd3, pd4, pdrX, pdrY, pdrZ, pe1, pe2, pe3, pe4, perX, perY, perZ) // translate <0, 0, 3> // scale < 0.7, 0.7, 0.7 > // } // object { // robo(20, 40, 10, -45, 32, -30, 0, -45, pd1*3, pd2*3, pd3*-2, pd4*2, pdrX*4, pdrY, pdrZ, pe1, pe2, pe3, pe4, 20, 40, 60) // translate <0, 7, 3> // scale < 0.4, 0.4, 0.4 > // } // object { // robo(60, -40, 35, -95, 12, -30, 0, -45, pd1*3, pd2*3, pd3*-2, pd4*2, pdrX*-1, pdrY*2, pdrZ*-3, 40, 30, 20, 10, 0, 40, 0) // translate <0, -7, 3> // scale < 0.4, 0.4, 0.4 > // } object { quadro(clock) translate <0, 0, 3> scale < 0.7, 0.7, 0.7 > } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 1.00 >; #declare raio_cena = 6.0; #declare dir_camera = < 14.00, -8.00, -5.00 >; #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)