This include file declares the following untextured objects:
WarpChess_Pawn WarpChess_Rook WarpChess_Knight WarpChess_Bishop WarpChess_Queen WarpChess_King
It also declares textured versions of these objects. These have the
word "White" or "Black" before the piece name, like:
WarpChess_WhitePawn WarpChess_BlackPawn etc.
The materials of the pieces can be modified by #declaring any of these
material identifiers before #including "WarpChess.inc":
WarpChess_BaseMaterial WarpChess_WhiteMaterial WarpChess_BlackMaterial
The materials can be transparent (and have ior). If the base of the pieces
should not use its own material (but simply share the material of the rest
of the piece), the identifier WarpChess_UseBaseMaterial can
be declared as false before the #include.
If the textured pieces should use a photons block, this can be
achieved by implementing a macro called WarpChess_UsePhotons()
before the #include. This macro should contain the entire photons block (ie.
"photons { ...something... }").
This include file also defines two macros to create a chessboard:
WarpChess_CreateDefaultBoard()
Simply creates a chessboard with all the pieces in their initial places.
WarpChess_CreateBoard(Moves)
Creates a chessboard based on the given moves. The parameter should be an array of strings, each string denoting a chess move. These moves are similar to the moves of a regular chess game record. The board situation is started from the initial position, and pieces are moved according to the given moves. Captured pieces are moved to the edge of the board.
Example usage:
#declare Moves = array[8]
{ "E2E4", "E7E5", "G1F3", "B8C6",
"D2D3", "F8B4", "B1C3", "G8F6" }
WarpChess_CreateBoard(Moves)
The following identifiers can be declared before #including
"WarpChess.inc" to affect the rendering:
WarpChess_WhiteSquareTexture WarpChess_BlackSquareTexture WarpChess_WoodTexture WarpChess_BoardLettersTexture WarpChess_BoardFont (default is "timrom.ttf") WarpChess_DropCapturedPieces (default is false)
If WarpChess_BoardFont is declared to be an empty string
the letters will not be created.
If WarpChess_DropCapturedPieces is true,
captured pieces will not be created at all, else they will be created at
the ends of the board.