// Exemplo de arquivo de descricao de cena para POV-ray // Last edited on 2023-08-16 20:54:02 by jevs // Original version by jstolfi // Moved Around by jevs // ====================================================================== // CORES E TEXTURAS background{ color rgb < 0.45, 0.10, 0.20 > } #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 5.0 } // ====================================================================== // DESCRI��O DA CENA #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 #macro testa_interpola3(p0, p1, p2, p3, n, r) #local k = 0; union { #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 // ======ALUNO SECTION END=============================================== // ====================================================================== #declare raio = 2.000; #declare raioIni = 3; #declare chao = disc { <0, 0, 0>, <0, 0, 1>, 200 texture { tx_xadrez } } #include "eixos.inc" // Aqui est� a cena, finalmente: union{ object{ eixos(3.00)} // quatrok(0, 0) // doisk(0, 0) // umk(0, 0) // tresk(0,0) // testa_interpola1(<0,0,0>, <10,10,10>, 5, 1) umk(0,0) umk(10,5) testa_interpola3(<0,0,0>, <1,2,5>, <2,2,-3>, <10,5,0>, 200, 0.15) object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } } #include "camlight.inc" #declare centro_cena = < 0.00, 0.00, 0.00 >; #declare raio_cena = 20.0; #declare dir_camera = < 10.00, -10.00, 10.00 >; #declare dist_camera = 10*raio_cena; #declare intens_luz = 1.20; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)