// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-10-11 16:15:14 by stolfilocal // Original version by jstolfi // Moved Around by jevs background{ color rgb < 0.45, 0.10, 0.20 > } #declare tx_bug = texture{ pigment{ color rgb < 1.000, 0.200, 0.000 > } finish{ diffuse 0.5 ambient 0.5 } } #declare tx_tanque = 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_cano = 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_xadrez = texture{ pigment{ checker color rgb < 0.15, 0.6 , 0 >, color rgb < 0, 0 , 0 > } finish{ diffuse 0.9 ambient 0.1 } scale 0.5 } #macro umk( px, py ) object{ union { sphere { <0, 0, 0>, 0.75 // , radius texture { tx_tanque } } cylinder { <0, 0, 0>, <0, 1, 0>, 0.25 // center of one end, center of other end, radius open // remove end caps texture { tx_cano } } } translate // } #end #macro doisk( px, py ) object{ union { union { box { <-1, -1, -0>, <1, 1, 2> texture { tx_tanque } } cylinder { <-1.5, 0, 0.25>, <1.5, 0, 0.25>, 0.25 // center of one end, center of other end, radius open // remove end caps texture { tx_cano } } } // prism { // linear_spline // 0, 1, 4, // Height 1, Height 2, Number of Points // <0,0>, <0,1>, <1,1>, <1,0> //points for outer rim // <0.5,0.5>,<0.5,1>, //points inner rim // translate <0, 0, 3> // // texture { // tx_cano // } // } // cylinder { // <-1.5, 0, 0.25>, <1.5, 0, 0.25>, 0.25 // center of one end, center of other end, radius // open // remove end caps // texture { // tx_cano // } // rotate <0, 0, 90> // // } } translate // } #end #macro quatrok( px, py ) object{ difference { union { union { torus { 0.5, .25 // major radius, minor radius rotate <90, 0, 0> // texture { tx_tanque } translate <0, 0, 0.25> // } cylinder { <-1.5, 0, 0.25>, <1.5, 0, 0.25>, 0.125 // center of one end, center of other end, radius open // remove end caps texture { tx_cano } } } cylinder { <-1.5, 0, 0.25>, <1.5, 0, 0.25>, 0.125 // center of one end, center of other end, radius open // remove end caps texture { tx_cano } rotate <0, 0, 90> // } } cylinder { <0, 0, -1>, <0, 0, 1>, 0.3 // center of one end, center of other end, radius } } translate // } #end #macro tresk( px, py ) object{ union { union { cylinder { <0, 0, 0>, <0, 0, 2>, 1 // center of one end, center of other end, radius texture { tx_tanque } } cylinder { <-1.5, 0, 0.25>, <1.5, 0, 0.25>, 0.25 // center of one end, center of other end, radius open // remove end caps texture { tx_cano } } } cylinder { <0, 0, 0.25>, <1.5, 0, 0.25>, 0.25 // center of one end, center of other end, radius open // remove end caps texture { tx_cano } rotate <0, 0, 90> // } } translate // } #end #macro interpola1(tt, t0, v0, t1, v1) #local ss = (tt - t0)/(t1-t0); #local vv = (1-ss)*v0+ss*v1; vv; #end //Algoritmo de DeCasteljan #macro interpola3(tt, ta, tb, v0, v1, v2, v3) #local v01 = interpola1(tt, ta, v0, tb, v1) #local v12 = interpola1(tt, ta, v1, tb, v2) #local v23 = interpola1(tt, ta, v2, tb, v3) #local v012 = interpola1(tt, ta, v01, tb, v12) #local v123 = interpola1(tt, ta, v12, tb, v23) #local v0123 = interpola1(tt, ta, v012, tb, v123) v0123 #end #macro testa_interpola1(p0, p1, n, r) #local k = 0; union { #while(k < n) #local centro = interpola1(k, 0, p0, n, p1); sphere { centro, r // , radius texture { tx_cano } } #local k = k + 1; #end } #end #include "bezpoly.inc" #macro testa_interpola3(p0, p1, p2, p3, n, r) #local k = 0; union { object{ bezpoly(p0, p1, p2, p3, 0.80*r) texture{ tx_bug } } #while(k < n) #local centro = interpola3(k, 1, n, p0, p1, p2, p3); sphere { centro, r // , radius texture { tx_cano } } #local k = k + 1; #end } #end #declare raio = 2.000; #declare raioIni = 3; #declare chao = disc { <0, 0, 0>, <0, 0, 1>, 200 texture { tx_xadrez } } #include "eixos.inc" union{ // object{ eixos(15.00)} // testa_interpola1(<0,0,0>, <10,10,10>, 5, 1) object{ umk(0,0) } object{ quatrok(5, 0) } object{ doisk(10, 0) } object{ tresk(15,0) } object{ testa_interpola3(<0,0,0>, <1,2,5>, <2,2,-3>, <10,5,0>, 200, 0.15) translate <3,3,3>} object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } } #declare cmin = < -2.5, -2.5, -1.0 >; #declare cmax = < +18.5, +9.5, +6.6 >; 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 = < 10.00, -10.00, 10.00 >; #declare dist_camera = 7*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)