/* mandala.pov */ /* XXX: * There are some variables named "wtf". * These are a work-around for some weird CSG problem * I was having. Set them to 0 to see it. * The "wtf" vars simply change how the link is cut, adding * space between the links and partially overlapping the borders. * FUCK ME: there are still problems. */ #local rad1 = .526; #local rad2 = rad1 - .033; #local irad2 = rad1 - (rad1 * .25); #local irad1 = irad2 + .033; #macro mandalalinkwhole(r1,r2,th) #local aa = array[5][5]; #local bb = array[5][5]; // The outer-most points #local i=0; #while (i<5) #local d = radians(i*72+90); #local aa[0][i] = < cos(d)*r1, sin(d)*r1 >; #local bb[0][i] = < cos(d)*r2, sin(d)*r2 >; #local i=i+1; #end // The other points #local i=1; #while (i<5) #local j=0; #while (j<5) #local aa[i][j] = (aa[i-1][j] + aa[i-1][mod(j+1,5)]) / 2; #local bb[i][j] = (bb[i-1][j] + bb[i-1][mod(j+1,5)]) / 2; #local j=j+1; #end #local i=i+1; #end #macro partpath(pts) pts[0][0] #local m=1; #while (m<5) pts[m][0] #local m=m+1; #end #local m=4; #while (m>0) pts[m][5-m] #local m=m-1; #end pts[0][0] #end prism { -th, th, 20, partpath(aa) partpath(bb) } #end #macro mandalalink(r1,r2,th) #local wtf = (r1-r2)/5; difference { object { mandalalinkwhole(r1,r2,th) } object { mandalalinkwhole(r1+wtf,r2-wtf,th+0.01) rotate <0,72,0> } object { mandalalinkwhole(r1+wtf,r2-wtf,th+0.01) rotate <0,216,0> } } #end #macro mandalaborder(r1,r2,r3,r4,th) #local wtf1 = (r1-r2)/5; #local wtf2 = (r3-r4)/5; intersection { merge { #local i=0; #while (i<5) difference { object { mandalalinkwhole(r1,r4,th+0.01) } object { mandalalinkwhole(r2,r3,th+0.01) } object { mandalalinkwhole(r2+wtf1,r3-wtf2,th+0.01) rotate <0,72,0> } object { mandalalinkwhole(r2+wtf1,r3-wtf2,th+0.01) rotate <0,216,0> } rotate <0,i*72,0> } #local i=i+1; #end } box { <-(r1+0.01),-th,-(r1+0.01)> } } #end /**/ #include "colors.inc" #include "stones.inc" #include "textures.inc" camera { direction <0, 0, 1> location <0, 1.7, 0.05> up <0, 1, 0> right look_at <0, 0, 0.05> } light_source { < 7, 20, 7> color rgb <1.0,1.0,1.0> } light_source { <-7, 20, 7> color rgb <0.4,0.4,0.4> shadowless } light_source { < 7, 20, -7> color rgb <0.4,0.4,0.4> shadowless } light_source { <-7, 20, -7> color rgb <0.4,0.4,0.4> shadowless } #declare txt = array[6]; #declare txt[0] = texture{pigment{color rgb <0.6,0.6,0.0>}}; #declare txt[1] = texture{pigment{color rgb <0.0,0.6,0.0>}}; #declare txt[2] = texture{pigment{color rgb <0.6,0.0,0.6>}}; #declare txt[3] = texture{pigment{color rgb <0.0,0.0,0.6>}}; #declare txt[4] = texture{pigment{color rgb <0.6,0.0,0.0>}}; #declare txt[5] = texture{pigment{color rgb <0.3,0.2,0.1>}}; /* #declare txt[0] = texture { T_Stone16 scale .05 }; #declare txt[1] = texture { T_Stone21 scale .1 }; #declare txt[2] = texture { T_Stone20 scale .1 }; #declare txt[3] = texture { T_Stone23 scale .1 }; #declare txt[4] = texture { T_Stone24 scale .1 }; #declare txt[5] = texture { DMFWood5 scale .05 rotate <0,5,10> }; */ object { mandalaborder(rad1,rad2,irad1,irad2,.73) texture {txt[5]} } #local i = 0; #while (i < 5) object { mandalalink(rad2,irad1,.7) texture {txt[i]} rotate <0,i*72,0> } #local i = i + 1; #end /**/