Sign inSign up

helmutqualtinger/chess3d

By helmutqualtinger

•Updated 7 months ago

3D chess game with glass pieces on marble board — play against Stockfish in your browser

Image
0

992

helmutqualtinger/chess3d repository overview

⁠3D Chess vs Stockfish

A fully interactive 3D chess game running in a Docker container. Play against the Stockfish engine through a beautiful Three.js board with realistic lighting, shadows, and procedural sound effects.

⁠Quick Start

docker run -d -p 8000:8000 helmutqualtinger/chess3d

Open http://localhost:8000⁠ in your browser.

⁠Features

  • True 3D board — Three.js scene with orbit controls (drag to rotate, scroll to zoom), shadow-casting directional lighting, procedural marble textures (cream and green), and a linen tablecloth
  • Glass chess pieces — Transparent crystal-glass white pieces and dark red glass pieces with physically-based rendering
  • Cognac glasses — Decorative snifter glasses with visible cognac liquid rendered through physically transparent glass
  • Captured pieces — Taken pieces are displayed on the tablecloth beside the board
  • Chess clocks — Bullet (1+0, 2+1), Blitz (3+2, 5+3), Rapid (10+5, 15+10), or Unlimited; defaults to Rapid 10+5
  • Configurable engine strength — Depth 10 (fast) to 20 (strong)
  • Sound effects — Procedurally synthesized glass-on-stone sounds via Web Audio API: move, capture, check, castle, game over
  • Play either side — Swap Sides rotates the camera and lets Stockfish open as white
  • Live evaluation — Eval bar updates after each move, always oriented from the player's perspective
  • Move indicators — Green dots for valid moves, red rings for captures
  • Animated moves — Pieces arc through the air with eased motion
  • Resign and Undo — Full game controls in the sidebar

⁠Configuration

Environment variables:

VariableDefaultDescription
STOCKFISH_DEPTH20Engine search depth
STOCKFISH_THREADS2CPU threads
STOCKFISH_HASH256Hash table size in MB
docker run -d -p 8000:8000 -e STOCKFISH_DEPTH=15 -e STOCKFISH_THREADS=4 helmutqualtinger/chess3d

⁠API Endpoints

MethodPathDescription
GET/Serves the 3D chess UI
GET/healthHealth check
POST/analyzeAnalyze a FEN position (best move + eval + top 3 lines)
POST/moveGet Stockfish's best response to a position
POST/uciRaw UCI command passthrough

⁠Tech Stack

LayerTechnology
EngineStockfish 17 (via apt)
BackendPython 3.12, FastAPI, Uvicorn
FrontendThree.js, Chess.js, Web Audio API
ContainerDocker

⁠Source

GitHub Repository⁠

Tag summary

Content type

Image

Digest

sha256:454d29a1c…

Size

112.6 MB

Last updated

7 months ago

docker pull helmutqualtinger/chess3d