#include "colors.inc" #include "textures.inc" #include "finish.inc" #include "stones1.inc" #include "stoneold.inc" #include "woods.inc" #version unofficial megapov 0.6; global_settings { ini_option "quality=11"//quality setting photons { count 50 autostop 0 jitter 1 max_trace_level 60 }} camera { location <-40,15,0> up <0,1,0> right <-4/3,0,0> look_at <0,3,0> rotate <0,10,0> angle 100 } #declare test = no; //yes = no pieces, useful for stting camera... // Create an infinite sphere around scene and allow any texture on it sky_sphere { pigment { color Black } } // An area light (creates soft shadows) /* WARNING: This special light can significantly slow down rendering times! light_source { 0*x // light's position (translated below) color rgb .25 // light's color area_light <8, 0, 0> <0, 0, 8> 4, 4 adaptive 0 jitter orient translate <0, 80, 0> media_interaction off media_attenuation off } */ light_source { <0,40,30> rgb 2*<.8,.8,1> spotlight point_at <0,0,10> radius 90 falloff 40 jitter media_interaction on media_attenuation on fade_distance 120 fade_power 2.5 photons{ global refraction on reflection on} } light_source { <0,40,-30> rgb 0.75*<1,.8,.8> spotlight point_at <0,0,-10> radius 30 falloff 40 jitter media_interaction on media_attenuation on fade_distance 120 fade_power 2.5 photons{ global refraction on reflection on} } box { -100,100 hollow pigment { rgbt 1 } } //chess square #macro chess_square (chess_sqr_material) difference{ box { <-1.9,-.2,-1.9><1.9,.2,1.9> } union{ box { <-.2,-1,-1.9><.2,1,1.9> rotate <0,0,-45> translate <-1.9,0,0>} box { <-.2,-1,-1.9><.2,1,1.9> rotate <0,90,0> rotate <45,0,0> translate <0,0,-1.9>} box { <-.2,-1,-1.9><.2,1,1.9> rotate <0,90,0> rotate <-45,0,0> translate <0,0,1.9>} box { <-.2,-1,-1.9><.2,1,1.9> rotate <0,0,45> translate <1.9,0,0>} box { <-.2,-1,-1.9><.2,1,1.9> rotate <0,0,45> translate <-1.9,0,0>} box { <-.2,-1,-1.9><.2,1,1.9> rotate <0,90,0> rotate <-45,0,0> translate <0,0,-1.9>} box { <-.2,-1,-1.9><.2,1,1.9> rotate <0,90,0> rotate <45,0,0> translate <0,0,1.9>} box { <-.2,-1,-1.9><.2,1,1.9> rotate <0,0,-45> translate <1.9,0,0>} } scale <1.1,1,1.1> translate <2,-.19999,2> material {chess_sqr_material} } #end #declare chessmaterialwhite = material { interior {ior 1.25 dispersion 1.05 caustics 4 } texture{ pigment{ rgbf <.9,.9,.9,.97>} finish { ambient 0.1 diffuse 0.3 reflection 0.1 specular 1 roughness 0.01 } }} #declare chessmaterialblack = material { interior {ior 1.25 dispersion 1.05 caustics 4} texture{ pigment{ rgbf <.8,.8,.9,.99>} finish { ambient 0.1 diffuse 0.3 reflection 0.1 specular 1 roughness 0.01 } }} //the pawn #declare pawn = merge{ cone { <0,0,0> 1.15 <0,.5,0> 1.0} torus{ 1.15,.075} torus{ 1,.05 translate <0,.5,0>} lathe{ cubic_spline 8, <0.607579,-0.140503>, <0.379737,-0.026582>, <0.189869,0.315182>, <0.151895,0.580998>, <0.151895,0.770866>, <0.189869,0.960735>, <0.303790,0.998709>, <0.531632,0.998709> scale <2.5,3,2.5> translate <0,.5,0> } intersection{ union { cone {<0,0,0> .9 <0,-1,0> .2 } cone {<0,0,0> .9 <0,1,0> .2 }} plane { y,.2} plane { -y,.2} translate <0,3.69,0>} sphere { <0,0.75,0> 0.75 translate < 0,3.75,0>} photons{ target 1 refraction on reflection on ignore_photons } } //the rook #declare rook = merge{ cone { <0,0,0> 1.05 <0,.5,0> 1.0} torus{ 1.05,.075} torus{ 1,.05 translate <0,.5,0>} lathe{ cubic_spline 8, <0.607579,-0.140503>, <0.379737,-0.026582>, <0.189869,0.315182>, <0.151895,0.580998>, <0.151895,0.770866>, <0.189869,0.960735>, <0.303790,0.998709>, <0.531632,0.998709> scale <2.5,3,2.5> translate <0,.5,0> } difference{ cylinder { <0,0,0> <0,.8,0> .775} cylinder { <0,.25,0> <0,2,0> .55} box { <-1,0,-5> <1,5,5> scale <0.15,1,1> translate <0,.45,0>} box { <-1,0,-5> <1,5,5> scale <0.15,1,1> translate <0,.45,0> rotate <0,120,0>} box { <-1,0,-5> <1,5,5> scale <0.15,1,1> translate <0,.45,0> rotate <0,240,0>} translate <0,3.48,0>} photons{ target 1 refraction on reflection on ignore_photons } scale 1.25 } //the bishop #declare bishop= merge{ cone { <0,0,0> 1.15 <0,.5,0> 1.0} torus{ 1.15,.075} torus{ 1,.05 translate <0,.5,0>} lathe{ cubic_spline 8, <0.607579,-0.140503>, <0.379737,-0.026582>, <0.189869,0.315182>, <0.151895,0.580998>, <0.151895,0.770866>, <0.189869,0.960735>, <0.303790,0.998709>, <0.531632,0.998709> scale <2.5,3,2.5> translate <0,.5,0> } intersection{ union { cone {<0,0,0> .9 <0,-1,0> .2 } cone {<0,0,0> .9 <0,1,0> .2 }} plane { y,.2} plane { -y,.2} translate <0,3.69,0>} merge{ difference{ sphere { <0,0,0> 0.65} box { <.25,.15,-2> <.05,2,2>rotate -12*z} scale <1,1.5,1> translate < 0,4.25,0>} sphere { <0,0,0> 0.25 translate <0,5.35,0>} sphere { <0,0,0>0.45 scale <1,1.5,1> translate <0,4.25,0>} } photons{ target 1 refraction on reflection on ignore_photons } } //the knight #declare knight= merge{ cone { <0,0,0> 1.15 <0,.5,0> 1.0} torus{ 1.15,.075} torus{ 1,.05 translate <0,.5,0>} merge{ difference{ merge{ box { <.75,0,.5> <-.75,1,-1.25> rotate -15*x translate <0,4,0>} box { <.5,0,.5> <-.5,1,-.5> translate <0,4.5,.5>} difference{ cylinder { <0,0,0> <0,5,0> 1} cylinder {<-5,0,0> <5,0,0> 5 scale <1,2,1> translate <0,5,-5.5>}} } sphere {<0,1.0,-1.5> 1 rotate 25*y scale <1,2.1,1> } sphere {<0,1.0,-1.5> 1 rotate -25*y scale <1,2.1,1> } sphere {<0,1.0,-1.5> .8 rotate 155*y scale <1,2.5,1> } sphere {<0,1.0,-1.5> .8 rotate 155*y scale <1,2.5,1> } cylinder {<0,0,-5> <0,0,5> 15 rotate 5*y translate <15.35,3.75,0>} cylinder {<0,0,-5> <0,0,5> 15 rotate -5*y translate <-15.35,3.75,0>} cylinder {<5,0,0> <-5,0,0> 14 translate <0,18.0,-5>} cylinder {<0,0,5> <0,0,-5> .1 scale <2,5,2> translate <0,5.5,0>} scale <1,1,1>} } photons{ target 1 refraction on reflection on ignore_photons } rotate <0,90,0> } // the king #declare king = merge{ cone { <0,0,0> 1.15 <0,.5,0> 1.0} torus{ 1.15,.075} torus{ 1,.05 translate <0,.5,0>} lathe{ cubic_spline 8, <0.607579,-0.140503>, <0.379737,-0.026582>, <0.189869,0.315182>, <0.151895,0.580998>, <0.151895,0.770866>, <0.189869,0.960735>, <0.303790,0.998709>, <0.531632,0.998709> scale <2.5,4,2.5> translate <0,.5,0> } intersection{ union { cone {<0,0,0> 1 <0,-1,0> .2 } cone {<0,0,0> 1 <0,1,0> .2 }} plane { y,.2} plane { -y,.2} translate <0,4.73,0>} superellipsoid {<1,.5> rotate 90*x scale <.65,1,.65> translate <0,4.75,0> } merge{ box{<-.2,0,-.1> <.2,1.6,.1> } box{<.5,.9,.2> <-.5,1.2,-.2>} translate <0,5.5,0>} photons{ target 1 refraction on reflection on ignore_photons } scale 1.1 } //the queen #declare queen= merge{ cone { <0,0,0> 1.15 <0,.5,0> 1.0} torus{ 1.15,.075} torus{ 1,.05 translate <0,.5,0>} lathe{ cubic_spline 8, <0.607579,-0.140503>, <0.379737,-0.026582>, <0.189869,0.315182>, <0.151895,0.580998>, <0.151895,0.770866>, <0.189869,0.960735>, <0.303790,0.998709>, <0.531632,0.998709> scale <2.5,4,2.5> translate <0,.5,0> } intersection{ union { cone {<0,0,0> 1 <0,-1,0> .2 } cone {<0,0,0> 1 <0,1,0> .2 }} plane { y,.2} plane { -y,.2} translate <0,5,0>} sphere { <0,0,0> 0.8 scale <1,1.3,1>translate <0,4.75-0> } sphere { <1,5,0> .2 rotate <0,0,0>} sphere { <1,5,0> .2 rotate <0,60,0>} sphere { <1,5,0> .2 rotate <0,120,0>} sphere { <1,5,0> .2 rotate <0,180,0>} sphere { <1,5,0> .2 rotate <0,240,0>} sphere { <1,5,0> .2 rotate <0,300,0>} photons{ target 1 refraction on reflection on ignore_photons } scale 1.1 } #declare row = 8; #declare row_count = 1; #declare col = 8; #declare tag = -1; #declare seed1 = seed(1123); #while (row_count <= row) #declare col_count = 1; #while (col_count <= col) #if (row_count = 2 & test = no ) //place pawns easier in a loop.... see below for rest of the pieces. object {pawn translate <-14+4*(col_count-1),0,-14+4*(row_count-1)> material {chessmaterialwhite}} #else #if (row_count = 7 & test = no ) object {pawn translate <-14+4*(col_count-1),0,-14+4*(row_count-1)> material {chessmaterialblack}} #else #end #end #if (tag = -1) //alternate chess square textures... #declare chess_sqr = material { texture {T_Stone11 scale 5+10*rand(seed1) rotate <360*rand(seed1),360*rand(seed1),360*rand(seed1)>}} #else #declare chess_sqr = material { texture {T_Stone13 scale 5+10*rand(seed1) rotate <360*rand(seed1),360*rand(seed1),360*rand(seed1)>}} #end #declare tag = tag*-1; object {chess_square(chess_sqr) translate <-16+4*(col_count-1),0,-16+4*(row_count-1)>} #declare col_count = col_count +1; #end #declare tag = tag*-1; #declare row_count =row_count +1; #end //axis.... #if (test = no) union{ //col -1 //row -1 object {rook translate <-14+4*(1-1),0,-14+4*(1-1)> material {chessmaterialwhite}} //row 1 col 1 object {rook translate <-14+4*(8-1),0,-14+4*(1-1)> material {chessmaterialwhite}} //row 1 col 8 object {rook translate <-14+4*(1-1),0,-14+4*(8-1)> material {chessmaterialblack}} //row 8 col 1 object {rook translate <-14+4*(8-1),0,-14+4*(8-1)> material {chessmaterialblack}} //row 8 col 8 object {knight rotate <0,90,0>translate <-14+4*(2-1),0,-14+4*(1-1)> material {chessmaterialwhite}} object {knight rotate <0,90,0> translate <-14+4*(7-1),0,-14+4*(1-1)> material {chessmaterialwhite}} object {knight rotate <0,-90,0> translate <-14+4*(2-1),0,-14+4*(8-1)> material {chessmaterialblack}} object {knight rotate <0,-90,0> translate <-14+4*(7-1),0,-14+4*(8-1)> material {chessmaterialblack}} object {bishop rotate <0,-90,0> translate <-14+4*(3-1),0,-14+4*(1-1)> material {chessmaterialwhite}} object {bishop rotate <0,-90,0> translate <-14+4*(6-1),0,-14+4*(1-1)> material {chessmaterialwhite}} object {bishop rotate <0,90,0> translate <-14+4*(3-1),0,-14+4*(8-1)> material {chessmaterialblack}} object {bishop rotate <0,90,0> translate <-14+4*(6-1),0,-14+4*(8-1)> material {chessmaterialblack}} object {queen translate <-14+4*(4-1),0,-14+4*(1-1)> material {chessmaterialwhite}} object {queen translate <-14+4*(4-1),0,-14+4*(8-1)> material {chessmaterialblack}} object {king translate <-14+4*(5-1),0,-14+4*(1-1)> material {chessmaterialwhite}} object {king translate <-14+4*(5-1),0,-14+4*(8-1)> material {chessmaterialblack}} } #else #end //box difference{ box {<-20,-2,-20> <20,0,20> } box {<-17,-.2,-17> <17,1,17> } merge{ //inner bevels merge{ cylinder {<-17,0,-17> <17,0,-17> .15 } cylinder {<-17,0,-17> <-17,0,17> .15 } cylinder {<17,0,17> <17,0,-17> .15 } cylinder {<17,0,17> <-17,0, 17> .15 } texture {Spun_Brass}} // outerbevels cylinder {<-20,0,-20> <20,0,-20> .75 } cylinder {<-20,0,-20> <-20,0,20> .75 } cylinder {<20,0,20> <20,0,-20> .75 } cylinder {<20,0,20> <-20,0, 20> .75 } } texture {T_Wood14 rotate <10,45,45> scale <15,1,2> }} //glass top box {<-17,-.2,-17> <17,0,17> interior {ior 1.2 caustics 4} pigment {rgbf <.95,.95,.95,.95> } finish { ambient 0.1 diffuse 0.3 reflection 0.1 specular 1 roughness 0.01 irid { 0.2 thickness 0.01 turbulence 0.5}} photons{ target 1 refraction on reflection on } }