3d-chess-opengl
3d-chess-opengl copied to clipboard
3D Chess game with OpenGL
3D Chess Game
This project is about chess game in 3D mode. Chess is a two-player strategy board game on a checkered board with 8x8 grid dimension. There is two player on each game which the first player as White and the second player as Black.

Getting started
To use this repository, you will need:
- C++
- FreeGLUT
Usage
- Clone this repository
git clone https://github.com/stevenalbert/3d-chess-opengl
- Compile C++ source code files
- Run the executable
Notes: To run this program please put the executable file and model directory in the same directory. This program has only been tested on Windows and Linux.
How to build and run on Linux
# build
mkdir -p bin && g++ main.cpp Model.cpp Chess/*.cpp `pkgconf --libs glut gl glu` -o bin/3d-chess-opengl
# run
bin/3d-chess-opengl
Game Details
Rules
- Each player started with 16 pieces (2
Rooks, 2Knights, 2Bishops, 1Queen, 1King, and 8Pawns) on respective side. - First turn is for
Whitepiece and next turn is forBlackpiece. - Other rules can be read in Rules of Chess - Wikipedia
State
Check- WhenKingis under immediate attack of opponent's pieceCheckmate-Checkstate without valid move left for the player to make theKingun-Check-edStalemate- Not inCheckstate but can't move other than move to theCheckitself (not implemented)
Result
Win- The player who givesCheckmateto opponentLose- The player who gotCheckmateDraw- There is no winner (not implemented)
Game Control
| Key | Action |
|---|---|
N |
Start new game |
W |
Move cursor forward 1 step |
A |
Move cursor left 1 step |
S |
Move cursor backward 1 step |
D |
Move cursor right 1 step |
Space |
Select piece Move piece Cancel move |
O |
Approve start new game |
X |
Close game after checkmateCancel start new game |
Q |
Promote to Queen |
R |
Promote to Rook |
B |
Promote to Bishop |
K |
Promote to Knight |