# DA Chess PGN Viewer

This is a demonstration of DirectAnimation in an application (as opposed to an applet). We use plain Java with simple AWT buttons for importing and viewing chess games represented in PGN files. Portable Game Notation (PGN) is a widely accepted format for recording chess games, files in this format can be found on the Internet, for example:

- Deep Blue VS Kasparov
- Club Kasparov

The parsing and the logic of the moves is all done in Java, while the 3D rendering of the chess board with the animation of the moves and the 3D camera controls are all done in DirectAnimation. This application illustrates the power of the union of these two systems.

TO INSTALL THE DA PGN VIEWER CLICK HERE.
To run the DA PGN Viewer, go to the C:\Program Files\DA_PGN_VIEWER\Classes directory and type: jview PGNViewFrame.class or simply double click on the PGN File after installing the DA PGN Viewer.

You should see a window with a chessboard appear. Use the File|Open menu to open a PGN file. We've placed some in the PGNFiles directory. Use the Next Move and Prev Move buttons to go through the moves. Click and hold the images in the corners to rotate the board or zoom in and out.

The Implementation

The application is broken into 3 parts:

- DirectAnimation
- AWT GUI
- PGN File Parser

The DirectAnimation is the interesting Part. This does all of the 3D graphics and animation. Look at the files ChessModel.java and ChessCanvas.java to learn more.

The AWT GUI is in PGNViewFrame.java and GameFrame.java. This code creates the windows, menu, and buttons you see.

The Parser translates the PGN text file into Move and Game structures. The files Parser.java, Piece.java, Pawn.java, King.java, Queen.java, Bishop.java, Knight.java, and Rook.java are used by the parser. This code is executed when you open a file, and is not used while running the animation

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.
Best viewed in 16-bit color with Internet Explorer 4.x.
Email contact for this page is dxmbeta@microsoft.com.