This is a collection of files that will take a correctly-formed pgn file and convert it into a renderable POV file.

The pgn2pov.exe executable merely makes a text file that calls the macros defined in pgn.inc.  It is a glorified parser that probably has some bugs.  Note:  It will only skip game variations (enclosed in braces).  It was compiled as a Win32 console app, but there's nothing to it, so I hope it's portable.  If you port it, please send me a copy so I can post/include it in the future.

Usage: pgn2pov.exe inputfile [outputfile] [-gn] [-mn]
	-g	convert game #n of the pgn file
	-m	stop converting after move #n
Note: the total number of moves is the number of white's moves plus the number of black's moves.
	e.g. a pgn file where black resigns on move 20 has 39 total moves

The pgn.pov is small and fairly straight-forward.  I had in mind that this is where you could define your own textures for the board, table and pieces (see below).  The last line is #include "chessgame.inc".  If you're not using the chess.ini file (or you change the 2nd argument of the pgn2pov.exe call), you'll probably want to change this to the name of the file you created with the pgn2pov.exe utility.

The pgn.inc file has all the macros and texture definitions (if not previously defined).  The macros simply translate pieces from the chess2.inc file.  This file contains the following textures:
	_textures[0]:	texture definition for white's pieces
	_textures[1]:	texture definition for black's pieces
	_textures[2]:	texture definition for white's captured pieces
	_textures[3]:	texture definition for black's captured pieces
	WhiteSquare:	texture definition of a light square
	BlackSquare:	texture definition of a dark square
	T_Board:	texture definition of chess board (a checker pattern of WhiteSquare, DarkSquare)
	T_Table:	texture definition of the table
If you want to override these textures, define them before the #include "pgn.inc" statement.  If you do not predefine them, the are defined for you in pgn.inc.  If chess_fancy is on, the default textures are a wood board and stone pieces.  If chess_fancy is off or undefined, the default textures are a blue/white plastic board and white and red plastic pieces.
This file contains the following macros:
	_Board(Who_are_you):	sets up the board and your viewing position (WHITE or BLACK)
	_Table():		draws the table
	Note:  the pgn2pov.exe will create and .inc file that will call all the necessary piece macros
	_Pawn(position, side):	draws a pawn at position (SAN), of color side (WHTIE or BLACK)
	_Rook(...), _Knight(...), ... all the same as the _Pawn macro

The chess2.inc file was shamelessly ripped off from the original chess2.pov included with the standard POV-Ray 3.5 distribution.  I simply trimmed it down to only the stuff I needed (basic chess pieces).  If I violated anyone, please email me and I will model my own pieces.

The chess.ini is not necessary, I included it to show how I like to easily use pgn2pov from inside POV-Ray.

Enjoy!

Reach me at:
cadman@graffiti.net
or
autocad2pov@povray.co.uk

