/********************************** *** lchess.pov - Lathe chess ********* *** Povray 3.0 scene with heavy use of 'lathe' for the chess pieces ************ *** Copyright (c) 1997 Knut Arild Erstad (s717@ii.uib.no) *** Distribute freely, of course. ************************************************************/ /* This is based upon my own (cheapish) wooden chess set :-> */ #include "colors.inc" #include "woods.inc" #declare Slow_light = 2 // 2=spotlights w/area, 1=spotlights, 0=off #declare Atmos = 0 // 1=on, 0=off (light "smoky" atmosphere) // I'm not really satisfied with the atmosphere. Off by 'default'. #declare LPawn = lathe { quadratic_spline 28, <0, 0.05>, // not shown <0, 0.05>, <0.9, 0>, <1, 0>, <1, 0.27>, <0.85, 0.32>, <1, 0.38>, <1, 0.6>, <0.5, 0.9>, <0.47, 1.1>, <0.4, 1.15>, <0.35, 1.17>, <0.3, 1.3>, <0.25, 1.73>, <0.47, 1.75>, <0.47, 1.9>, <0.27, 2.0>, <0.3, 2.1>, <0.4, 2.2>, <0.45, 2.3>, <0.48, 2.4>, <0.5, 2.5>, <0.48, 2.6>, <0.45, 2.7>, <0.4, 2.8>, <0.32, 2.9>, <0.18, 3.0>, <0, 3.03> } #declare LRook = lathe { quadratic_spline 22, <0, 0.05>, // not shown <0, 0.05>, <0.8, 0>, <1.05, 0.05>, <1.1, 0.3>, <1, 0.35>, <1.1, 0.42>, <1.1, 0.65>, <0.75, 0.96>, <0.8, 1.1>, <0.7, 1.3>, <0.67, 2.55>, <0.75, 2.55>, <0.8, 2.75>, <0.9, 2.75>, <0.9, 3>, <0.8, 3.05>, <0.9, 3.1>, <0.9, 3.25>, <0.85, 3.25>, <0.2, 3.1>, <0, 3.1> } #declare LBishop = lathe { quadratic_spline 26, <0, 0.05>, // not shown <0, 0.05>, <0.8, 0>, <1.05, 0.05>, <1.1, 0.3>, <1, 0.35>, <1.1, 0.42>, <1.1, 0.7>, <0.55, 1.25>, <0.65, 1.5>, <0.55, 1.75>, <0.4, 2.45>, <0.81, 2.6>, <0.87, 2.8>, <0.81, 2.87>, <0.5, 3.05>, <0.6, 3.2>, <0.5, 3.35>, <0.6, 3.5>, <0.6, 3.7>, <0.5, 4>, <0.38, 4.25>, <0.15, 4.5>, <0.2, 4.55>, <0.18, 4.75>, <0, 4.8> } #declare LKnight = union { // base lathe { quadratic_spline 13, <0, 0.05>, // not shown <0, 0.05>, <0.8, 0>, <1.05, 0.05>, <1.1, 0.3>, <1, 0.35>, <1.1, 0.42>, <1.1, 0.7>, <0.5, 0.9>, <0.55, 1.0>, <0.7, 1.15>, <0.6, 1.3>, <0, 1.3> } // horse (top) part difference { prism { linear_spline -0.3, 0.3, 22, <-0.3, 0>, <0.7, 0>, <0.9, 0.5>, <1, 1>, <1.05, 1.4>, <0.97, 1.9>, <0.85, 2.1>, <0.65, 2.3>, <0.3, 2.4>, <0.25, 2.8>, // ears <0.2, 2.8>, <0.1, 2.4>, <-1, 2.1>, <-1, 2>, <-0.95, 1.9>, // mouth <-1, 1.8>, <-1, 1.7>, <-0.5, 1.68>, <0, 1.5>, <-0.9, 0.5>, <-0.9, 0.4>, <-0.3, 0> } // cut away eyes: torus { 0.10, 0.05 translate <-0.18, 0.34, 2.13> } sphere { <-0.18, 0.34, 2.13>, 0.05 } torus { 0.10, 0.05 translate <-0.18, -0.34, 2.13> } sphere { <-0.18, -0.34, 2.13>, 0.05 } // hairstyling: #declare Count=0 #while (Count<8) cone { <0.3+(Count*0.05), 0.3, 2.1-(Count*0.22)>, 0 <2.3+(Count*0.05), 0.7, 2.9-(Count*0.22)>, 0.5 } #declare Count=Count+1 #end // fix ears: box { <-1,0,0>, <1,1,1> rotate x*45 translate z*2.6 } // move on top of base rotate -x*90 translate <-0.1, 1.3, 0> } rotate y*20 // looks a little better? } #declare LQueen = lathe { quadratic_spline 32, <0, 0.05>, //not shown <0, 0.05>, <0.9, 0>, <1.15, 0.05>, <1.2, 0.3>, <1.1, 0.5>, <1.2, 0.6>, <1.2, 0.9>, <0.55, 1.45>, <0.75, 1.85>, <0.75, 1.9>, <0.5, 2.3>, <0.4, 2.95>, <0.6, 3>, <0.9, 3.1>, <0.9, 3.35>, <0.72, 3.5>, <0.55, 3.65>, <0.71, 3.8>, <0.71, 3.9>, <0.45, 4.05>, <0.5, 4.5>, <0.8, 4.8>, <0.75, 5>, <0.6, 5.05>, <0.53, 5.2>, <0.4, 5.4>, <0.23, 5.5>, <0.28, 5.55>, <0.28, 5.8>, <0.1, 5.9>, <0, 5.92> } #declare LKing = union { // lathe part (bottom) lathe { quadratic_spline 28, <0, 0.05>, //not shown <0, 0.05>, <0.9, 0>, <1.15, 0.05>, <1.2, 0.3>, <1.1, 0.5>, <1.2, 0.6>, <1.2, 0.9>, <0.55, 1.45>, <0.75, 1.85>, <0.75, 1.9>, <0.5, 2.3>, <0.4, 2.95>, <0.6, 3>, <0.9, 3.1>, <0.9, 3.35>, <0.72, 3.5>, <0.55, 3.65>, <0.71, 3.8>, <0.71, 3.9>, <0.45, 4.05>, <0.7, 5>, <0.75, 5.3>, <0.7, 5.5>, <0.5, 5.55>, <0.45, 5.7>, <0.4, 5.75>, <0, 5.75> } // cross part prism { linear_spline -0.15, 0.15, 18, <-0.3, 0>, <0.3, 0>, <0.3, 0.05>, <0.5, 0.1>, <0.49, 0.33>, <0.25, 0.45>, <0.3, 0.7>, <0.28, 0.73>, <0.2, 0.75>, <0, 0.765>, <-0.2, 0.75>, <-0.28, 0.73>, <-0.3, 0.7>, <-0.25, 0.45>, <-0.49, 0.33>, <-0.5, 0.1>, <-0.3, 0.05>, <-0.3, 0> rotate -x*90 translate y*5.75 } } #declare LWhite = texture { T_Wood10 scale 2 rotate x*93 rotate z*4 translate x*2 // finish { phong 0.3 phong_size 2 } finish { specular 0.3 roughness 0.2 ambient 0.3 } } #declare LBlack = texture { T_Wood2 // finish { phong 0.3 phong_size 2 } finish { specular 0.3 roughness 0.2 ambient 0.3 } } // Size of each chess frame; probably around 4 - 4.5 #declare LFrameSize = 4.2 #declare LBoard = union { // main board box { <0, -1, 0>, <8, 0, 8> texture { checker texture {LWhite rotate -x*90 rotate y*90}, texture {LBlack rotate y*93} scale <1, 1.1, 1> translate y*0.05 } } // borders box { <-0.05, -2, -0.05>, <8.05, -0.001, 8.05> texture {LBlack} } box { <-0.1, -2, -0.1>, <8.1, -0.002, 8.1> texture {LWhite} } box { <-0.28, -2, -0.28>, <8.28, -0.003, 8.28> texture {LBlack} } box { <-0.5, -2.01, -0.5>, <8.5, -0.004, 8.5> texture {LWhite} } scale } #declare f1 = LFrameSize*0.5 #declare f2 = LFrameSize*1.5 #declare f3 = LFrameSize*2.5 #declare f4 = LFrameSize*3.5 #declare f5 = LFrameSize*4.5 #declare f6 = LFrameSize*5.5 #declare f7 = LFrameSize*6.5 #declare f8 = LFrameSize*7.5 #declare A1 = #declare B1 = #declare C1 = #declare D1 = #declare E1 = #declare F1 = #declare G1 = #declare H1 = #declare A2 = #declare B2 = #declare C2 = #declare D2 = #declare E2 = #declare F2 = #declare G2 = #declare H2 = #declare A3 = #declare B3 = #declare C3 = #declare D3 = #declare E3 = #declare F3 = #declare G3 = #declare H3 = #declare A4 = #declare B4 = #declare C4 = #declare D4 = #declare E4 = #declare F4 = #declare G4 = #declare H4 = #declare A5 = #declare B5 = #declare C5 = #declare D5 = #declare E5 = #declare F5 = #declare G5 = #declare H5 = #declare A6 = #declare B6 = #declare C6 = #declare D6 = #declare E6 = #declare F6 = #declare G6 = #declare H6 = #declare A7 = #declare B7 = #declare C7 = #declare D7 = #declare E7 = #declare F7 = #declare G7 = #declare H7 = #declare A8 = #declare B8 = #declare C8 = #declare D8 = #declare E8 = #declare F8 = #declare G8 = #declare H8 = #declare LBoardWPieces = union { object { LBoard } // Now for the pieces; this is Argest vs Karlsson, Stockholm -97; // Black moves... object { LRook texture {LWhite} translate A1 } object { LKing texture {LWhite} translate E1 } object { LRook texture {LWhite} translate H1 } object { LPawn texture {LWhite} translate A2 } object { LPawn texture {LWhite} translate C2 } object { LPawn texture {LWhite} translate F2 } object { LBishop texture {LWhite} translate G2 } object { LPawn texture {LWhite} translate H2 } object { LPawn texture {LWhite} translate C3 } object { LBishop texture {LWhite} translate E3 } object { LQueen texture {LWhite} translate F3 } object { LPawn texture {LWhite} translate F5 } object { LBishop texture {LBlack} translate D5 } object { LPawn texture {LBlack} translate G5 } object { LRook texture {LBlack} translate H5 } object { LPawn texture {LBlack} translate C6 } object { LQueen texture {LBlack} translate E6 } object { LPawn texture {LBlack} translate A7 } object { LPawn texture {LBlack} translate B7 } object { LKnight texture {LBlack} translate D7 } object { LKing texture {LBlack} translate C8 } object { LRook texture {LBlack} translate D8 } translate <-LFrameSize*4, 0, -LFrameSize*4> } /********* Scene starts here ********/ /************************\ *** Chess board *** \************************/ object { LBoardWPieces } /************************\ *** Blue floor/table *** \************************/ plane { y, -2 pigment { color rgb <0, 0.3, 0.5> } } /************************\ *** Camera *** \************************/ camera { location <-30, 30, -3> look_at <0, -12, 2> } /************************\ *** Atmosphere *** \************************/ #if (Atmos) atmosphere { type 4 samples 20 distance 50 scattering 0.02 aa_level 8 aa_threshold 0.5 jitter 0.2 } #end /************************\ *** (Spot)lights *** \************************/ light_source { <-45, 120, -60> White #if (Slow_light>1) area_light <40, 0, 0>, <0, 0, 40>, 5, 5 adaptive 1 jitter #end #if (Slow_light) spotlight point_at <0, 0, 0> radius 8 falloff 14 tightness 10 #end atmosphere off } light_source { <150, 90, -60> White #if (Slow_light>1) area_light <40, 0, 0>, <0, 0, 40>, 5, 5 adaptive 1 jitter #end #if (Slow_light) spotlight point_at <0, 0, 0> radius 6 falloff 10 tightness 5 #end } //// END of lchess.pov