/* POV-Ray sample scene CHESS SET INCLUDE */ // This work is licensed under the POV-Ray v3.7 distribution license. // To view a copy of this license, visit http://www.povray.org/licences/v3.7/. // Persistence Of Vision raytracer sample file. // POV-Ray scene description for chess board. // By Ville Saari // Copyright (c) 1991 Ferry Island Pixelboys // // Note : CHESS-SET_MOD.INC was created from Ville Saari's chess.pov // -- Dan Farmer 1996 // - Changed textures // - Added camera blur and changed focal length // - Use sky sphere // - Modularized the code // - Added felt pads to bottom of pieces // Gave Knight/horse two ears, was only one, and remaining manual bounding // commented out, August 31, 2001, by Bob Hughes. // And modified again 2016.85, changes to King crown and Knight, resized pieces // to be similar to a Staunton chess set. // Things from shapes_old.inc replaced with isosurfaces and primitives. #ifndef(Chess_mod_Inc_Temp) #declare Chess_mod_Inc_Temp=version; #version 3.7; #ifdef(View_POV_Include_Stack) #debug "including chess-set_mod.inc\n" #end #include "woods.inc" //#include "shapes_old.inc" #ifndef (ChessBoard) #declare ChessBoard=no; #end #ifndef (WhitePaint) #local WhitePaint=no; #end #ifndef (RedBlack) #local RedBlack=no; #end #ifndef (GlassPieces) #local GlassPieces=no; #end #ifndef (Pho) #local Pho=no; #end #ifndef (Dsp) #local Dsp=no; #end /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */ /* MATERIALS */ #declare Felt_M= material { texture { pigment { agate agate_turb 1.5 scale 0.33 color_map { [0.11 srgbf <0.01,0.8,0.2,1>] [0.33 srgb <0.01,0.8,0.2>] } } normal { agate 0.33 agate_turb 1.5 scale 0.33 } finish { ambient 0.01 emission 0.03 diffuse 0.3 specular 0.05 roughness 0.2 reflection { 0,0.05 } conserve_energy subsurface { translucency <0.025,0.4,0.2> } } // end finish } // end texture interior { ior 1.1 } } // end material #declare Ivory_M= material { texture { pigment { srgb <1,0.96,0.77> } finish { ambient 0.03 emission 0.04 brilliance 1.1//,1.5 diffuse albedo 0.87 specular albedo 0.9 roughness 0.02 //fresnel on // use only with 3.7.1.1-alpha or later versions reflection { 0,0.5 fresnel exponent 0.67 } conserve_energy subsurface { translucency <1,0.96,0.77>/2 } } // end finish } // end texture interior { ior 1.54 } } // end material #declare Ebony_M= material { texture { pigment { srgb <1,0.7,0.7>/8 } finish { ambient 0.0 emission 0.005 brilliance 1.4//,1.9 diffuse albedo 0.33 specular albedo 0.5 roughness 0.03 //fresnel on // use only with 3.7.1.1-alpha or later versions reflection { 0,0.5 fresnel exponent 0.8 } conserve_energy subsurface { translucency <1,0.7,0.7>/3 } } // end finish } // end texture interior { ior 1.66 } } // end material #declare Redpaint_M= material { texture { pigment { aoi color_map { [0 srgb <0.99,0.07,0.03>] [0.35 srgb <0.85,0.1,0.035>] [0.5 srgb <0.7,0.15,0.05>] [0.65 srgb <0.85,0.1,0.035>] [1 srgb <0.99,0.07,0.03>] } } normal { bumps 0.1 scale 0.2 } finish { ambient 0.01 emission 0.02 //brilliance 1.4,0.8 diffuse albedo 0.8 specular albedo 0.2 roughness 0.04 //fresnel on reflection { 0,0.1 fresnel on exponent 0.7 } conserve_energy /* subsurface { translucency <0.9,0.07,0.03> } */ } // end finish } // end texture interior { ior 1.6 } } // end material #declare Whitepaint_M= material { texture { pigment { aoi color_map { [0 srgb <0.99,0.99,0.99>] [0.35 srgb <0.85,0.8,0.67>] [0.5 srgb <0.8,0.7,0.5>] [0.65 srgb <0.85,0.8,0.67>] [1 srgb <0.99,0.99,0.99>] } } normal { bumps 0.1 scale 0.2 } finish { ambient 0.03 emission 0.03 //brilliance 1.4,0.8 diffuse albedo 0.8 specular albedo 0.2 roughness 0.04 //fresnel on reflection { 0,0.1 fresnel on exponent 0.8 } conserve_energy /* subsurface { translucency <0.9,0.07,0.03> } */ } // end finish } // end texture interior { ior 1.6 } } // end material #declare GlassClear_M= material { texture { pigment { srgbf <0.95,0.99,0.97,0.999> } finish { ambient 0.0 emission 0.0 //brilliance 0,0.1 diffuse albedo 0.1 specular albedo 0.99 roughness 0.003 //fresnel on reflection { 0,0.5 fresnel on exponent 0.6 } conserve_energy subsurface { translucency <0.01,0.012,0.011> } } // end finish } // end texture interior { ior 1.51 #if (Dsp=on) dispersion 1.06 dispersion_samples 9 #else caustics 0.3 #end fade_color <0.95,0.99,0.97> fade_distance 1 fade_power 2 } } // end material #declare GlassOpaque_M= material { texture { pigment { srgbf <0.8,0.2,0.1,0.99> } finish { ambient 0.0 emission 0.005 //brilliance 0.1,0.2 diffuse albedo 0.1 specular albedo 0.99 roughness 0.003 //fresnel on reflection { 0,0.5 fresnel on exponent 0.7 } conserve_energy subsurface { translucency <0.8,0.2,0.1> } } // end finish } // end texture interior { ior 1.51 #if (Dsp=on) dispersion 1.06 dispersion_samples 9 #else caustics 0.3 #end fade_color <0.8,0.2,0.1> fade_distance 1 fade_power 2 } } // end material /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */ /* SHAPES */ #declare HyperY=function(x,y,z){pow(x,2) + pow(z,2) - exp(pow(-y/2,2))} #declare Hyp_Y=isosurface{function{HyperY(x,y,z)} threshold 0 contained_by{sphere{0,4}} max_trace 3 max_gradient 13 scale <1.25,1,1.25> //translate -y*0.167 } #declare Cyl_X=cylinder{-11*x,11*x,1} #declare Cyl_Y=cylinder{-11*y,11*y,1} #declare Cyl_Z=cylinder{-11*z,11*z,1} #declare Con_Y=cone{0,0,y,1 scale <3.33,3.33,3.33>} /* ***************************************************************** */ /* OBJECTS */ #declare PawnBase = merge { intersection { sphere { <0, 0, 0>, 2.5 } plane { -y, -0.001 } } merge { cylinder { 0, y*0.25, 2.4 } // felt pad torus { 2.4, 0.25/2 translate y*0.25/2 } translate -y*0.05 #if (GlassPieces=no) material {Felt_M} #end } translate y*0.05 } #declare PieceBase = merge { intersection { sphere { <0, 0, 0>, 3 } plane { -y, -0.001 } } merge { cylinder { 0, y*0.25, 2.9 } // felt pad torus { 2.9, 0.25/2 translate y*0.25/2 } translate -y*0.05 #if (GlassPieces=no) material {Felt_M} #end } translate y*0.05 } // PAWN #declare Pawn = merge { sphere { <0, 7, 0>, 1.5 } // top ball sphere { <0, 0, 0>, 1 scale <1.2, 0.3, 1.2> translate 5.5*y } intersection { // shank plane { y, 5.5 } object { Hyp_Y//Hyperboloid_Y translate 5*y scale <0.5, 1, 0.5> } plane { -y, -2.5 } } // end intersection sphere { <0, 0, 0>, 1 scale <2, 0.5, 2> translate <0, 2.3, 0> } object { PawnBase } scale <0.85,0.85,0.85> translate y*0.15 } // end merge pawn // ROOK/CASTLE #declare Rook = merge { intersection { // turrets merge { plane { +x, -0.5 } plane { -x, -0.5 } plane { y, 9.5 } } merge { plane { +z, -0.5 } plane { -z, -0.5 } plane { y, 9.5 } } plane { y, 10 } object { Cyl_Y scale <2, 1, 2> } object { Cyl_Y scale <1.2, 0.2, 1.2> translate y*11 inverse } plane { -y, -8 } } // end intersection intersection { // shank plane { y, 8 } object { Hyp_Y//Hyperboloid_Y scale <1, 1.367, 1> translate y*5.333//5.401924*y } plane { -y, -3 } } // end intersection sphere { <0, 0, 0>, 1 scale <2.5, 0.5, 2.5> translate 2.8*y } object { PieceBase } scale <0.75,0.8,0.75> translate y*0.15 } // end merge rook // KNIGHT/HORSE #declare Knight = merge { merge { difference { intersection { object { Cyl_Z // side scale <17.875, 17.875, 1> rotate y*4 translate <-18.625, 7, 0> inverse } object { Cyl_Z // side scale <17.875, 17.875, 1> rotate -y*4 translate <18.625, 7, 0> inverse } object { Cyl_X // back head and ears scale <1, 5.1, 5.1> translate <0, 11.2, -5> inverse //pigment {rgb<1,1,0>} } merge { // upper head cylinder { z,-z,1 scale <1.5,0.75,3> rotate x*40 translate y*8.567 } plane { z, 0 // front ears rotate -20*x translate 10*y //pigment {rgb <0,1,1>} } //pigment {red 1} } // end merge merge { // lower head and front neck plane { -y, 0 rotate 15*x translate 7.15*y } plane { y, 0 rotate 60*x translate 7.3*y } //pigment {blue 1} } // end merge merge { // middle ears plane { y, 0 rotate -40*z } plane { y, 0 rotate 40*z } translate 9.333*y //pigment {green 1} } // end merge merge { object { cylinder {0,0.599*y,1 scale <1.8, 11, 2>}} // lower back/front neck object { cylinder {0.57*y,y,1 scale <1.8, 11, 2.015>} // nose and upper back neck rotate x*15 translate -z*1.67} } sphere { <0, 7, 0>, 4 } // bottom cut } // end intersection box { -1,1 // mouth scale <1,0.125,0.333> rotate x*15 translate <0,7,2>} } // end difference union { // eyes sphere {-x*0.67,0.3} sphere {x*0.67,0.3} translate <0,8.3,0.3> } sphere { <0, 0, 0>, 1 // skirt scale <2.5, 0.5, 2.5> translate <0, 2.8, 0> } object { PieceBase } scale <0.825,0.95,0.825> } // end 2nd merge difference { // mane sphere { 0,1 } union { #for (It,0,135,15) cylinder {-x,x,0.1 scale <1,1.5-It/675,1.5+It/675> translate y rotate x*20 translate <0,-0.05+(It/1080),-0.025> rotate -x*It} #end } box {<-1,-0.67,-1>,<1,1,0> rotate x*18 inverse} scale <0.3,1.5,1.2>*1.9 rotate -x*4 translate <0,6.85,0.05> // pigment {rgb <1,0,0>} } // pigment {rgb 1} translate y*0.0133 } // end merge knight // BISHOP #declare Bishop = merge { sphere { <0, 10.8, 0>, 0.4 scale <1.1,1,1.1>} // top ball intersection { // mitre merge { plane { -z, -0.25 } plane { +z, -0.25 } plane { y, 0 } rotate 30*x translate 8.5*y } sphere { <0, 0, 0>, 1 scale <1.4, 2.1, 1.4> translate 8.4*y } plane { -y, -7 } } // end intersection sphere { <0, 0, 0>, 1 scale <1.5, 0.4, 1.5> translate 7*y } intersection { // shank plane { y, 7 } object { Hyp_Y//Hyperboloid_Y scale <0.6, 1.67, 0.6>//<0.6, 1.4, 0.6> translate 7*y } plane { -y, -3 } } // end intersection sphere { <0, 0, 0>, 1 scale <2.5, 0.5, 2.5> translate 2.8*y } object { PieceBase } scale <0.875,0.975,0.875> translate y*0.0133 } // end merge bishop // QUEEN #declare Queen = merge { sphere { <0, 12.2, 0>, 0.4 } // top ball sphere { <0, 10.5, 0>, 1.5 } // upper crown hemisphere intersection { // crown merge { sphere { <1.75, 12, 0>, 0.9 rotate 150*y } sphere { <1.75, 12, 0>, 0.9 rotate 120*y } sphere { <1.75, 12, 0>, 0.9 rotate 90*y } sphere { <1.75, 12, 0>, 0.9 rotate 60*y } sphere { <1.75, 12, 0>, 0.9 rotate 30*y } sphere { <1.75, 12, 0>, 0.9 } sphere { <1.75, 12, 0>, 0.9 rotate -30*y } sphere { <1.75, 12, 0>, 0.9 rotate -60*y } sphere { <1.75, 12, 0>, 0.9 rotate -90*y } sphere { <1.75, 12, 0>, 0.9 rotate -120*y } sphere { <1.75, 12, 0>, 0.9 rotate -150*y } sphere { <1.75, 12, 0>, 0.9 rotate 180*y } inverse } // end merge plane { y, 11.5 } object { Con_Y//QCone_Y scale <1, 3, 1> translate 5*y } plane { -y, -8 } } // end intersection sphere { <0, 0, 0>, 1 scale <1.8, 0.4, 1.8> translate 8*y } intersection { // shank plane { y, 8 } object { Hyp_Y//Hyperboloid_Y scale <0.7, 1.6, 0.7> translate 7*y } plane { -y, -3 } } // end intersection sphere { <0, 0, 0>, 1 scale <2.5, 0.5, 2.5> translate 2.8*y } object { PieceBase } translate y*0.01 } // end merge queen // KING #declare King = merge { superellipsoid { <0.1, 0.9> // topmost finial cap clipped_by {plane {z,0}} scale 0.3875 rotate 90*x translate 13.841*y } intersection { // finial box { -0.75, 0.75 } union { box { -1, <0,0,1.1> rotate -45*z scale <1,0.5,1> rotate 45*z translate <-0.2,-0.2,0> } box { -1, <0,0,1.1> rotate -45*z scale <1,0.5,1> rotate -45*z translate <-0.2,0.2,0> } box { -1, <0,0,1.1> rotate -45*z scale <1,0.5,1> rotate 45*z translate <-0.2,-0.2,0> scale <-1,1,1> } box { -1, <0,0,1.1> rotate -45*z scale <1,0.5,1> rotate -45*z translate <-0.2,0.2,0> scale <-1,1,1> } inverse } scale <1,1,0.5> translate 13.1*y } // end intersection sphere { <0, 12.15, 0>, 0.5 } // crown cap top ball sphere { <0, 11.525, 0>, 0.51 scale <4.25,1,4.25> } // crown cap intersection { // head/lower crown plane { y, 11.5 } object { Con_Y//QCone_Y scale <1, 3, 1> translate 5*y } plane { -y, -8 } } // intersection sphere { <0, 0, 0>, 1 scale <1.8, 0.4, 1.8> translate 8*y } intersection { // shank plane { y, 8 } object { Hyp_Y//Hyperboloid_Y scale <0.7, 1.6, 0.7> translate 7*y } plane { -y, -3 } } // end intersection sphere { <0, 0, 0>, 1 scale <2.5, 0.5, 2.5> translate 2.8*y } object { PieceBase } translate y*0.01 } // end merge king /* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& */ // sets #declare WPawn = object { Pawn } #declare BPawn = object { Pawn } #declare WRook = object { Rook } #declare BRook = object { Rook } #declare WKnight = object { Knight } #declare BKnight = object { Knight rotate 180*y } #declare WBishop = object { Bishop } #declare BBishop = object { Bishop rotate 180*y } #declare WQueen = object { Queen } #declare BQueen = object { Queen } #declare WKing = object { King } #declare BKing = object { King } #declare FarSide = union { object { BPawn translate <-28, 0, 20> } object { BPawn translate <-20, 0, 20> } object { BPawn translate <-12, 0, 20> } object { BPawn translate < -4, 0, 20> } object { BPawn translate < 4, 0, 20> } object { BPawn translate < 12, 0, 20> } object { BPawn translate < 20, 0, 20> } object { BPawn translate < 28, 0, 20> } object { BRook translate <-28, 0, 28> } object { BKnight translate <-20, 0, 28> } object { BBishop translate <-12, 0, 28> } object { BQueen translate < -4, 0, 28> } object { BKing translate < 4, 0, 28> } object { BBishop translate < 12, 0, 28> } object { BKnight translate < 20, 0, 28> } object { BRook translate < 28, 0, 28> } } #declare NearSide = union { object { WPawn translate <-28, 0, -20> } object { WPawn translate <-20, 0, -20> } object { WPawn translate <-12, 0, -20> } object { WPawn translate < -4, 0, -20> } object { WPawn translate < 4, 0, -20> } object { WPawn translate < 12, 0, -20> } object { WPawn translate < 20, 0, -20> } object { WPawn translate < 28, 0, -20> } object { WRook translate <-28, 0, -28> } object { WKnight translate <-20, 0, -28> } object { WBishop translate <-12, 0, -28> } object { WQueen translate < -4, 0, -28> } object { WKing translate < 4, 0, -28> } object { WBishop translate < 12, 0, -28> } object { WKnight translate < 20, 0, -28> } object { WRook translate < 28, 0, -28> } } #declare SetPieces = union { #if (GlassPieces=yes) object { NearSide material {GlassClear_M} #if (Pho=on) photons { target refraction on reflection off //collect on } #end } object { FarSide material {GlassOpaque_M} #if (Pho=on) photons { target refraction on reflection off //collect on } #end } #else #if (WhitePaint=no) object { NearSide material {Ivory_M} } #else object { NearSide material {Whitepaint_M} } #end #if (RedBlack=no) object { FarSide material {Ebony_M} } #else object { FarSide material {Redpaint_M} } #end #end } #declare FrameSection= intersection { cylinder { -z,z,1 scale <1,1,33>} box {-1,1 scale 22.67 rotate y*45} texture {T_Wood14 rotate 4} } #declare SetBoard = // base at -y*2.001 union { union { object { FrameSection translate -x*32 } object { FrameSection rotate y*90 translate -z*32 } object { FrameSection rotate y*180 translate x*32 } object { FrameSection rotate y*90 translate z*32 } translate <0,-1,0> } // end union box { -1, 1 scale <31.999,1,31.999> translate <0,-1.001,0> texture { checker texture {T_Wood8 rotate <9,0,0> translate 0.5} texture {T_Wood23 rotate <-19,80,0> translate 0.5} warp {repeat <1,0,0> flip <1,0,1>} scale <8,8,8> } //#if (Pho=on) //photons {target collect on} //#end } } // end union #if (ChessBoard=yes) object { SetPieces } object { SetBoard } #end #version Chess_mod_Inc_Temp; #end