// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-10-12 00:17:47 by stolfilocal background{ color rgb < 0.75, 0.80, 0.85 > } #declare tx_bug = texture{ pigment{ color rgb < 1.000, 0.200, 0.000 > } finish{ diffuse 0.5 ambient 0.5 } } #declare tx_tanque_grande = texture{ pigment{ color rgb < 0.41, 0.41, 0.41 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_tanque_pequeno = texture{ pigment{ color rgb < 0.50, 0.50, 0.50 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_tanque_medio = texture{ pigment{ color rgb < 0.66, 0.66, 0.66 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_cano = texture{ pigment{ color rgb < 1, 1, 1 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare tx_black = texture{ pigment{ color rgb < 0.400, 0.400, 0.400 > } finish{ diffuse 0.8 ambient 0.1 specular 0.5 roughness 0.005 } } #declare raioBaseTanqueGrande = 5; #declare raioSuperiorTanqueGrande = 2; #declare raioBaseTanqueMedio = 4.5; #declare raioBaseTanquePequeno = 3; #declare raioSuperiorTanquePqueno = 1; // Partes do peao: #declare baseGrande = cylinder{ < 0, 0, 0.0 >, < 0, 0, 14.0 >, raioBaseTanqueGrande texture{ tx_tanque_grande } } #declare baseMedio = cylinder{ < 0, 0, 0.0 >, < 0, 0, 5.0 >, raioBaseTanqueMedio texture{ tx_tanque_medio } } #declare basePequeno = cylinder{ < 0, 0, 0.0 >, < 0, 0, 12.0 >, raioBaseTanquePequeno texture{ tx_tanque_pequeno } } #declare superiorGrande = cone{ < 0, 0, 14 >, raioBaseTanqueGrande, < 0, 0, 18 >, raioSuperiorTanqueGrande texture{ tx_tanque_grande} } #declare superiorMedio = sphere{ < 0, 0.0, 5 >, 4.3 texture{ tx_tanque_medio } } #declare superiorPequeno = cone{ < 0, 0, 12.0 >, raioBaseTanquePequeno, < 0, 0, 16.5 >, raioSuperiorTanquePqueno texture{ tx_tanque_pequeno} } #declare divisasPequeno = cylinder{ < 0, 0, 0.0 >, < 0, 0, 1.0 >, 3.3 texture{ tx_tanque_pequeno } } #declare cano1 = cylinder{ < 0, 0, 0.0 >, < 5.2, 0, 0.0 >, 0.5 texture{ tx_cano } } #declare cano2 = cylinder{ < 0, 0, 0.0 >, < -5.2, 0, 0.0 >, 0.5 texture{ tx_cano } } #declare cano3 = cylinder{ < 0, 0, 0.0 >, < 0, 5.2, 0.0 >, 0.5 texture{ tx_cano } } #declare cano4 = cylinder{ < 0, 0, 0.0 >, < 0, -5.2, 0.0 >, 0.5 texture{ tx_cano } } #macro tanqueGrande(i, j) union{ object { baseGrande translate < i, j, 0 > } object { superiorGrande translate < i, j, 0 > } object { cano1 translate < i, j, 1 > } object { cano2 translate < i, j, 1 > } } #end #macro tanqueMedio(i, j) union{ object { baseMedio translate < i, j, 0 > } object { superiorMedio translate < i, j, 0 > } object { cano1 translate < i, j, 1 > } object { cano2 translate < i, j, 1 > } object { cano3 translate < i, j, 1 > } } #end #macro tanquePequeno(i, j) union{ object { basePequeno translate < i, j, 0 > } object { superiorPequeno translate < i, j, 0 > } object { divisasPequeno translate < i, j, 3 > } object { divisasPequeno translate < i, j, 6 > } object { divisasPequeno translate < i, j, 9 > } object { cano1 translate < i, j, 1 > } object { cano2 translate < i, j, 1 > } object { cano3 translate < i, j, 1 > } object { cano4 translate < i, j, 1 > } } #end #macro gera_tanques(n, m) union { #declare lin = 0; #declare roleta1 = seed(123123); #while (lin < n) #declare col = 0; #while (col < m) #declare index = 3*rand(roleta1); #if (index > 1) #if (index > 2) object { tanquePequeno(20*lin, 20*col) } #else object { tanqueMedio(20*lin, 20*col) } #end #else object { tanqueGrande(20*lin, 20*col) } #end #declare col = col + 1; #end #declare lin = lin + 1; #end } #end #macro interpola1(t_curr, t0, v0, t1, v1) #local ss = (t_curr - t0)/(t1 - t0); #local vv = (1 - ss)*v0 + ss * v1; vv #end #macro testa_interpola_1(p0, p1, n, raio) union{ #declare k = 0; #while (k < n) #local centro = interpola1(k, 2, p0, 4, p1); object { sphere{ centro, raio texture{ tx_black } } } #declare k = k + 1; #end } #end #macro interpola3(t_curr, ta, tb, v0, v1, v2, v3) #local v01 = interpola1(t_curr, ta, v0, tb, v1); #local v12 = interpola1(t_curr, ta, v1, tb, v2); #local v23 = interpola1(t_curr, ta, v2, tb, v3); #local v012 = interpola1(t_curr, ta, v01, tb, v12); #local v123 = interpola1(t_curr, ta, v12, tb, v23); #local v0123 = interpola1(t_curr, ta, v012, tb, v123); v0123 #end #include "bezpoly.inc" #macro testa_interpola_3(p0, p1, p2, p3, n, raio) union{ object{ bezpoly(p0, p1, p2, p3, 0.8*raio) texture{ tx_bug } } #declare k = 0; #while (k < n) #local centro = interpola3(k, 0, n, p0, p1, p2, p3); object { sphere{ centro, raio texture{ tx_black } } } #declare k = k + 1; #end } #end #include "eixos.inc" union{ // object{ eixos(40) } object { testa_interpola_3(<0, 0, 0>, <10, 40, 10>, <20, -40, 10>, <40, 0, 0>, 200, 1) } } #declare cmin = < -5, -45, -2 >; #declare cmax = < +45, +45, +12 >; box{ cmin, texture{ pigment{ color rgb <0.80,0.70,0.60> } finish {diffuse 0.7 ambient 0.3 } } } #include "camlight.inc" #declare centro_cena = (cmin + cmax)/2; #declare raio_cena = 0.55*vlength(cmin - cmax); #declare dir_camera =< -14.00, 7.00, 12.00 >; // < 0.001, 0.000, 1.000 >; // #declare dist_camera = 5*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)