//Chessmen Macro-Collection // by Tim Nikias Wenclawiak //Last Update: 11.11.00 /* All Figurines are called the same way: "Name" ( Position, Rotation, Color (0=White,1=Black), Seed) Of importance is the Seed-Number. It is used to randomly find a Wood-Texture used for the figurine, thus, it should be different for every one. The board is called with Board( Position ). In it, the CBoard-Macro is set up, so that the macro CBoard(X,Y) can be used to position the chessmen on the chessboard. */ //Queen Measures: Height 4.8 cm Base-Diam. 2 cm //King Measures: Height 5.6 cm Base-Diam. 2 cm //Bishop Measures: Height 4.6 cm Base-Diam. 2 cm //Knight Measures: Height 4.1 cm Base-Diam. 2 cm //Tower Measures: Height 3.5 cm Base-Diam. 2 cm //Pawn Measures: Height 3 cm Base-Diam. 2 cm //Measurement-Macros (if not already included with umacro.inc by me) #ifndef (UMacro_Included) #macro km(KiloMetres) 1000*KiloMetres #end #macro dm(Dezimetres) 10*Dezimetres #end #macro cm(Centimetres) .01*Centimetres #end #macro mm(Millimetres) .001*Millimetres #end #end //Texture-Macro #macro Wood(Color,Val) #declare Rand = seed(Val); #declare Move = rand(Rand); #declare Rotate = rand(Rand); material{ texture{ pigment{ wood color_map{ [0 rgb <.55,.35,.0>-Color*<.4,.3,0>] [.4 rgb <.75,.45,0>-Color*<.4,.4,0>] [1 rgb <.95,.65,0>-Color*<.5,.45,0>]} warp{turbulence 1.1} rotate x*79 scale cm(1.3) warp{turbulence .8} translate y*2*Move quick_color rgb <.95,.65,0>-Color*<.5,.4,0> } normal{wood mm(.05) warp{turbulence 1.1} rotate x*79 scale cm(1.3) warp{turbulence .8}translate y*2*Move} finish{phong 1.2} } interior{} rotate y*360*Rotate } #end //Queen //Measures: Height 4.8 cm Base-Diam. 2 cm #macro Queen(Position,Rotation,Color,Val, Scale) union{ /*merge*/ //Main Stem cone{ 0,mm(8) y*cm(3),mm(5)} //Main-Base torus{ mm(9),mm(1) translate y*mm(1)} cylinder{ y*mm(1) y*mm(4),cm(1)} torus{ mm(9),mm(1) translate y*mm(4)} //Secondary Base torus{ mm(7),mm(3) translate y*mm(7)} cone{ y*mm(7),cm(1) y*cm(1.3),mm(7)} torus{ cm(.7),mm(1) translate y*cm(1.3)} //Crown-Part //Base Torus torus{ mm(8),mm(1) translate y*cm(3.1)} cylinder{ y*cm(3),y*cm(3.2),mm(8)} cone{y*cm(3),mm(8) y*cm(2.9),mm(5)} cone{y*cm(3.2),mm(8) y*cm(3.3),mm(5)} //Inner Section until mid-torus torus{ mm(5),mm(1) translate y*cm(3.4)} cone{ y*cm(3.4),mm(6) y*cm(3.1),mm(7)} cylinder{y*cm(3.5) y*cm(3.6) mm(5.5)} //Mid-Torus torus{ mm(5),mm(1) translate y*cm(3.7)} //The Actual Crown-Part torus{ mm(8),mm(1) translate y*cm(4.4)} cylinder{ y*cm(4.3),y*cm(4.4),mm(8)} cone{y*cm(4.3),mm(8) y*cm(4),mm(5)} cylinder{ y*cm(4),y*cm(3.7),mm(5)} //Little Ball on top, with cone-base cone{y*cm(4.4),mm(8) y*cm(4.6),mm(0)} sphere{ y*cm(4.5),mm(3)} Wood(Color,Val) scale Scale rotate Rotation translate Position } #end //King //Measures: Height 5.6 cm Base-Diam. 2 cm #macro King(Position,Rotation,Color,Val,Scale) union{ /*merge*/ //Main Stem cone{ y*mm(2),mm(8) y*cm(3.2),mm(5)} //Main-Base torus{ mm(9),mm(1) translate y*mm(1)} cylinder{ y*mm(1) y*mm(4),cm(1)} torus{ mm(9),mm(1) translate y*mm(4)} //Secondary Base torus{ mm(7),mm(3) translate y*mm(7)} cone{ y*mm(7),cm(1) y*cm(1.5),mm(7)} torus{ cm(.7),mm(1) translate y*cm(1.5)} //Crown-Part //Base Torus torus{ mm(8),mm(1) translate y*cm(3.3)} cylinder{ y*cm(3.2),y*cm(3.4),mm(8)} cone{y*cm(3.2),mm(8) y*cm(3.1),mm(5)} cone{y*cm(3.4),mm(8) y*cm(3.5),mm(5)} //Inner Section through mid-torus //torus{ mm(5),mm(1) translate y*cm(3.4)} //cone{ y*cm(3.4),mm(6) y*cm(3.1),mm(7)} cylinder{y*cm(3.4) y*cm(4.1) mm(5)} //Mid-Torus torus{ mm(5),mm(1) translate y*cm(3.8)} //The Actual Crown-Part cone{ y*cm(4.1),mm(5) y*cm(4.6),mm(8)} torus{ mm(7),mm(1) translate y*cm(4.6)} cone{ y*cm(4.6),mm(8) y*cm(4.8),mm(2)} cone{ y*cm(4.8),mm(2) y*cm(4.9),0} //The Cross superellipsoid{ <.35,.35> scale translate y*cm(5)} superellipsoid{ <.35,.35> scale translate y*cm(5.3)} Wood(Color,Val) scale Scale rotate Rotation translate Position } #end //Tower //Measures: Height 3.5 cm Base-Diam. 2 cm #macro Tower(Position,Rotation,Color,Val, Scale) union{ /*merge*/ //Main Stem cone{ y*cm(1.3),mm(7) y*cm(2.6),mm(5)} //Main-Base torus{ mm(9),mm(1) translate y*mm(1)} cylinder{ y*mm(1) y*mm(4),cm(1)} torus{ mm(9),mm(1) translate y*mm(4)} //Secondary Base torus{ mm(8),mm(2) translate y*mm(6)} cone{ y*mm(6),cm(1) y*cm(1),mm(7)} torus{ mm(8),mm(1) translate y*cm(1.1)} cone{ y*cm(1.1),mm(9) y*cm(1.3),mm(7)} //Head-Section, made up of a collection of torii and cylinders torus{ mm(5),mm(1) translate y*cm(2.6)} cylinder{ y*cm(2.6),y*cm(2.7),mm(6)} torus{ mm(6),mm(1) translate y*cm(2.8)} cylinder{ y*cm(2.8),y*cm(2.9),mm(7)} torus{ mm(7),mm(1) translate y*cm(3)} cylinder{ y*cm(3),y*cm(3.1),mm(8)} torus{ mm(8),mm(1) translate y*cm(3.2)} difference{ cylinder{ y*cm(3.2),y*cm(3.4),mm(9)} sphere{0,mm(7) scale <1,.25,1> translate y*cm(3.4)} } torus{ mm(8),mm(1) translate y*cm(3.4)} Wood(Color,Val) scale Scale rotate Rotation translate Position } #end //Bishop //Measures: Height 4.6 cm Base-Diam. 2 cm #macro Bishop(Position,Rotation,Color,Val, Scale) union{ /*merge*/ //Main Stem cone{ y*cm(1.4),mm(7) y*cm(2.7),mm(5)} //Main-Base torus{ mm(9),mm(1) translate y*mm(1)} cylinder{ y*mm(1) y*mm(4),cm(1)} torus{ mm(9),mm(1) translate y*mm(4)} //Secondary Base torus{ mm(8),mm(2) translate y*mm(6)} cone{ y*mm(6),cm(1) y*cm(1),mm(8)} torus{ mm(7),mm(1) translate y*cm(1.3)} cylinder{ y*cm(1.1),y*cm(1.3),mm(8)} torus{ mm(7),mm(1) translate y*cm(1.1)} //Head torus{ mm(7),mm(1) translate y*cm(2.9)} cylinder{ y*cm(2.8),y*cm(3),mm(7)} cone{y*cm(3),mm(7) y*cm(3.1),mm(6)} cone{y*cm(2.9),mm(8) y*cm(2.7),mm(5)} difference{ sphere{ 0,mm(6) scale <1,1.33,1>} cylinder{x*-cm(1),x*cm(1),mm(5) scale <1,.25,.75> rotate x*35 translate y*mm(2)-z*mm(6)} translate y*cm(3.5)} sphere{ y*cm(4.4),mm(2)} Wood(Color,Val) scale Scale rotate Rotation translate Position } #end //Pawn //Measures: Height 3 cm Base-Diam. 2 cm #macro Pawn(Position,Rotation,Color,Val, Scale) union{ /*merge*/ //Main Stem cone{ y*cm(1.2),mm(5) y*cm(1.9),mm(4)} //Main-Base torus{ mm(9),mm(1) translate y*mm(1)} cylinder{ y*mm(1) y*mm(3),cm(1)} torus{ mm(9),mm(1) translate y*mm(3)} //Secondary Base torus{ mm(8),mm(2) translate y*mm(5)} cone{ y*mm(5),cm(1) y*mm(9),mm(8)} torus{ mm(7),mm(1) translate y*mm(9)} cylinder{ y*mm(9),y*cm(1),mm(8)} torus{ mm(7),mm(1) translate y*cm(1)} cone{ y*cm(1),mm(8) y*cm(1.2),mm(5)} //Head cone{ y*cm(1.8),mm(4) y*cm(2),mm(6)} torus{ mm(5),mm(1) translate y*cm(2)} cone{ y*cm(2),mm(6) y*cm(2.2),mm(4)} sphere{ y*cm(2.5),mm(5)} Wood(Color,Val) scale Scale rotate Rotation translate Position } #end //Knight //Measures: Height 4.6 cm Base-Diam. 2 cm #macro Knight(Position,Rotation,Color,Val, Scale) //Using Inverse-Kinematics, the Head of the Horse looks way better #declare Neck_Transform = transform{ rotate z*80 translate <-mm(5),mm(5),0>} #declare Head_Transform = transform{ rotate z*-85 translate } #declare Snout_Transform = transform { rotate z*-40 translate <.7,0,0>} union{ /*merge*/ //Main-Base torus{ mm(9),mm(1) translate y*mm(1)} cylinder{ y*mm(1) y*mm(5),cm(1)} torus{ mm(9),mm(1) translate y*mm(5)} //Secondary Base torus{ mm(8),mm(2) translate y*mm(7)} cone{ y*mm(7),cm(1) y*cm(1.1),mm(7)} torus{ mm(6),mm(2) translate y*cm(1.2)} cone{ y*cm(1.2),mm(8) y*cm(1.8),mm(6)} //Using Inverse-Kinematics, the Head of the Horse looks way better #declare Neck_Transform = transform{ rotate z*80 translate <-.5,.5,0>} #declare Head_Transform = transform{ rotate z*-85 translate <1.2,0,0>} #declare Snout_Transform = transform { rotate z*-40 translate <.7,0,0>} //Neck-Apex union{ cylinder{ <-.5,.5,-.3> <-.5,.5,.3>,.5} sphere{ 0,1 scale <.5,.5,.3> translate<-.5,.5,-.3>} sphere{ 0,1 scale <.5,.5,.3> translate<-.5,.5,.3>} cylinder{ -x*.5, x*.5,1 scale <1,.5,.3> translate <0,.5,.3>} cylinder{ -x*.5, x*.5,1 scale <1,.5,.3> translate <0,.5,-.3>} box{<-.5,0,-.3><.5,1,.3>} //cylinder{ <0,.5,-.3> <0,.5,.3>,.5 scale <1.5,1,1> translate x*.5} //sphere{ 0,1 scale <.75,.5,.3> translate<.5,.5,-.3>} //sphere{ 0,1 scale <.75,.5,.3> translate<.5,.5,.3>} cylinder{ <0,.5,-.3> <0,.5,.3>,.5 scale <1,1,1> translate x*.5} sphere{ 0,1 scale <.5,.5,.3> translate<.5,.5,-.3>} sphere{ 0,1 scale <.5,.5,.3> translate<.5,.5,.3>} scale .01 translate y*cm(1.4)} union{ //Neck difference{ union{ cylinder{ <1.2,0,-.3><1.2,0,.3>,.5 } box{<1.2,-.5,-.3><0,.5,.3>} sphere{ 0,1 scale <.5,.5,.1> translate<1.2,0,-.3>} sphere{ 0,1 scale <.5,.5,.1> translate<1.2,0,.3>} sphere{ 0,1 scale <.5,.5,.1> translate<0,0,-.3>} sphere{ 0,1 scale <.5,.5,.1> translate<0,0,.3>} cylinder{ 0,x*1.2,1 scale <1,.5,.1> translate <0,0,.3>} cylinder{ 0,x*1.2,1 scale <1,.5,.1> translate <0,0,-.3>} } #declare Cuts = 0; #while (Cuts < 4) sphere{0,1 scale <.05,.4,.1> translate <.5+.2*Cuts,.5,.3>} sphere{0,1 scale <.05,.4,.1> translate <.5+.2*Cuts,.5,-.3>} #if (Cuts < 3) sphere{0,1 scale <.05,.4,.1> translate <0,.5,.3> rotate z*-10-z*25*Cuts translate x*1.2} sphere{0,1 scale <.05,.4,.1> translate <0,.5,-.3> rotate z*-10-z*25*Cuts translate x*1.2} #end #declare Cuts=Cuts+1; #end transform Neck_Transform} //Head union{ cylinder{ <.7,0,-.3><.7,0,.3>,.4 } box{<.7,-.4,-.3><0,.4,.3>} sphere{ 0,1 scale <.4,.4,.1> translate<.7,0,-.3>} sphere{ 0,1 scale <.4,.4,.1> translate<.7,0,.3>} sphere{ 0,1 scale <.2,.4,.1> translate<0,0,-.3>} sphere{ 0,1 scale <.2,.4,.1> translate<0,0,.3>} cylinder{ 0,x*.7,1 scale <1,.4,.1> translate <0,0,.3>} cylinder{ 0,x*.7,1 scale <1,.4,.1> translate <0,0,-.3>} translate y*.1 transform Head_Transform transform Neck_Transform} //Snout union{ cylinder{ <.5,0,-.3><.5,0,.3>,.3 } box{<.5,-.3,-.3><0,.3,.3>} sphere{ 0,1 scale <.3,.3,.1> translate<0,0,-.3>} sphere{ 0,1 scale <.3,.3,.1> translate<0,0,.3>} sphere{ 0,1 scale <.3,.3,.1> translate<.5,0,-.3>} sphere{ 0,1 scale <.3,.3,.1> translate<.5,0,.3>} cylinder{ 0,x*.5,1 scale <1,.3,.1> translate <0,0,.3>} cylinder{ 0,x*.5,1 scale <1,.3,.1> translate <0,0,-.3>} translate y*.1 transform Snout_Transform translate y*.1 transform Head_Transform transform Neck_Transform } scale <.01,.01125,.01> translate y*cm(1.4)} sphere{ y*cm(3.9),mm(2)} Wood(Color,Val) scale Scale rotate Rotation translate Position } #end //The Chessboard #declare Board_Finish = finish{specular .9 roughness .02 reflection .6 metallic} #declare White_Marble = pigment{agate color_map{[0 rgb 0][.1 rgb .8][1 rgb 1]} turbulence .5 scale 2 warp{turbulence .4}warp{turbulence .05}} #declare Black_Marble = pigment{agate color_map{[0 rgb 1][.1 rgb .2][1 rgb 0]} turbulence .5 scale 2 warp{turbulence .4} translate 4 warp{turbulence .05}} #macro Board( Position ) mesh{ triangle{<-cm(9.6),0,-cm(9.6)>,,} triangle{<-cm(9.6),0,cm(9.6)>,,<-cm(9.6),0,-cm(9.6)>} //plane{y,mm(1) pigment{checker pigment{White_Marble} pigment{Black_Marble}scale cm(2.4)} normal{bozo .001 turbulence .4 warp{turbulence .4} scale cm(2)} finish{Board_Finish} //clipped_by{box{ <-cm(9.6),-.1,-cm(9.6)> }} translate Position } #end #macro CBoard(X,Y,BoardPosition) #if (X <= 4) #local X_Pos = (5-X)*.024-.012; #else #local X_Pos = -(X-4)*.024+.012; #end #if (Y <= 4) #local Z_Pos = (5-Y)*.024-.012; #else #local Z_Pos = -(Y-4)*.024+.012; #end (+BoardPosition) #end