#include "retalho.inc" // CORES E TEXTURAS background{ color rgb < 0.75, 0.80, 0.85 > } #declare roleta = seed(477); #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_money = texture{ pigment{ color rgb < 0, 1, 0 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_tronco = texture{ pigment{ color rgb <1, 0.7, 0.7 > } finish{ diffuse 0.9 ambient 0.1 } } #declare tx_fosca = texture{ pigment{ color rgb < 0.7, 0.1, 0.2 > } finish{ diffuse 0.1 reflection 0.7*< 0.7, 0.1, 0.2 > ambient 0.1 } } #declare tx_vidro = texture{ pigment{ color rgb < 1, 1, 1.00 > filter 0.70 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.01 roughness 0.005 } } #declare tx_glass = texture{ pigment{color rgb < 0.8, 0.8, 1 > filter 0.90 } finish{ diffuse 0.03 reflection 0.25 ambient 0.02 specular 0.01 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 = 5.000; #declare prob = 0.1; // Partes da cena: #declare fi = (sqrt(5)-1)/2; #declare fi2 = (sqrt(5)+1)/2; #macro interpola(t0,v0,t1,v1,tt) #local ss=(tt-t0)/(t1-t0); #local rr=1-ss; (rr*v0+ss*v1); #end #macro interpola4(t0,v0,v1,v2,v3,t3,tt) #local v01 = interpola(t0,v0,t3,v1,tt); #local v12 = interpola(t0,v1,t3,v2,tt); #local v23 = interpola(t0,v2,t3,v3,tt); #local v012 = interpola(t0,v01,t3,v12,tt); #local v123 = interpola(t0,v12,t3,v23,tt); interpola(t0,v012,t3,v123,tt) #end #macro calc_retalho(p11,p12,p13,p14,p21,p22,p23,p24,p31,p32,p33,p34,p41,p42,p43,p44,q11,q12,q13,q14,q21,q22,q23,q24,q31,q32,q33,q34,q41,q42,q43,q44,rad,txg,txr) retalho (p21+q31/2,p22+q32/2,p23+q33/2,p24+q34/2,p21,p22,p23,p24,p31,p32,p33,p34,p41,p42,p43,p44, rad,txg,txr) retalho (q11,q12,q13,q14,q21,q22,q23,q24,q31,q32,q33,q34,p21+q31/2,p22+q32/2,p23+q33/2,p24+q34/2, rad,txg,txr) #end #macro grafico(x0,y0,y1,y2,y3,x3,n) #local i=1; #local xx=x0; #while(i <= n) #local aux =(x3-x0)/n; #local xx=xx+aux; #local yy=interpola4(x0,y0,y1,y2,y3,x3,xx); object{sphere{yy 0.1 texture{tx_money}}} #local i=i+1; #end #end #macro graf(x00,y00,y10,y20,y30,x30,x01,y01,y11,y21,y31,x31,x02,y02,y12,y22,y32,x32,x03,y03,y13,y23,y33,x33,n) union { grafico(x00,y00+y33/2,y10,y20,y30+y01/2,x30,n) grafico(x01,y30+y01/2,y11,y21,y31+y02/2,x31,n) grafico(x02,y31+y02/2,y12,y22,y32+y03/2,x32,n) grafico(x03,y32+y03/2,y13,y23,y00+y33/2,x33,n) } #end #declare chao = box{ <-20,-20,-1>, <+20,+20,0> } #include "eixos.inc" // Aqui está a cena, finalmente: object{ chao translate < 0,0,-5 > texture{ tx_xadrez } } object{ eixos(3.00) } //grafico(0,0,7,0,4,9,25) //graf(1,1,-1,4,2,5,5,1,-5,8,15,10,10,1,-4,9,2,15,15,1,-1,4,3,20,150) //grafico(0,<0,0,0>,<0,1,1>,<0,3,2>,<0,0,4>,9,200) union{ graf(0,<0,0,-2>,<0,2,-3.9>,<0,3,-1>,<0,2,0>,5,10,<0,2,0>,<0,3,1>,<0,4,3>,<0,0,2>,20,20,<0,0,1>,<0,-2,2>,<0,-3,3>,<0,-2,1>,30,30,<0,-2,1>,<0,-3,0>,<0,-2,-3>,<0,1,-3>,40,150) translate<0,5,0> } //retalho(<1,1,1>,<1,2,3>,<1,3,1>,<1,4,1.5>,<2,1,0>,<2,2,2>,<2,3,1>,<2,3,2>,<3,1,-2>,<3,2,0>,<3,3,-4>,<3,4,0>,<4,1,1>,<4,2,0>,<4,3,0>,<4,4,0>,0.009,tx_money,tx_plastico) union{ calc_retalho(<1,1,1>,<1,2,1>,<1,3,1>,<1,4,1>,<2,1,0>,<2,2,2>,<2,3,1>,<2,4,1>,<3,1,0>,<3,2,0>,<3,3,-2>,<3,4,0>,<4,1,1>,<4,2,0>,<4,3,0>,<4,4,0>, <-4,1,1>,<-4,2,1>,<-4,3,1>,<-4,4,1.5>,<-3,1,0>,<-3,2,2>,<-3,3,1>,<-3,3,2>,<-2,1,-2>,<-2,2,0>,<-2,3,-2>,<-2,4,0>,<0,1,1>,<0,2,0>,<0,3,0>,<0,4,0>,0.009,tx_money,tx_plastico) rotate z*90 } #include "camlight.inc" #declare centro_cena = < 2, 0, 6 >; #declare raio_cena = 7; #declare dir_camera = < 2,-1,2 >; #declare dist_camera = 20; #declare intens_luz = 1.00; camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)