Skip to content

ninja297/Chess_board

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess_board

Interactive Chessboard (PyOpenGL)

Author: SALONI KUSHWAHA Roll: 24IT3045
Course: Graphics and Visual Computing (GVC)


🎯 Objective

Build an Interactive 3D Chessboard using PyOpenGL showing:

  • Orthographic & Perspective Projection (switch with P)
  • Camera system (orbit, zoom)
  • Modeling pipeline (board + pieces using primitives)
  • Lighting (Phong)
  • Animation (piece movement)
  • Picking (click to select piece)
  • Roll-number–based customization

📌 Project Summary

A fully interactive 3D Chessboard built using Python, PyOpenGL, GLFW, NumPy, and ImGui, demonstrating all major GVC concepts including modelling, transformations, lighting, rendering pipeline, Z-buffering, camera controls, and ray-casting.

🎯 Features

  • 3D chessboard & pieces (procedurally modelled: cube, cylinder, cone)
  • Camera: orbit, pan, zoom, reset
  • Piece selection & movement animation
  • Perspective ↔ Orthographic projection switching
  • Ray-casting based picking
  • Phong lighting (ambient, diffuse, specular)
  • Z-buffer depth testing
  • ImGui UI panel

🛠 Graphics Concepts Used (GVC)

  • Modelling Pipeline: Piece meshes generated manually (VAO/VBO + normals)
  • Transformations: Model → View → Projection matrices
  • Viewing: Custom LookAt camera
  • Projections: Perspective & Orthographic switching
  • Lighting: Phong shading in GLSL shaders
  • Rendering: Framebuffer clearing, draw calls, depth testing
  • Z-Buffer: glEnable(GL_DEPTH_TEST)
  • Interaction: Ray picking → world intersection → board square mapping
  • Animation: Time-based interpolation for piece movement

📘 Challenges Faced

  • Accurate ray picking
  • UI overlay interfering with GLFW inputs
  • Stable orthographic mode interaction
  • Procedural modelling of all pieces
  • Camera orbit smoothing

🚀 Scope for Improvement

  • Full chess rules + turn-based logic
  • Load real 3D models (Blender/Maya)
  • Shadows, reflections, PBR materials
  • Move history, undo/redo, game export
  • AI opponent using Minimax

📚 References

  • OpenGL Red Book
  • LearnOpenGL.com
  • PyOpenGL documentation
  • ImGui docs
  • GVC lecture notes

🛠️ Tech Stack

  • Python 3
  • PyOpenGL
  • GLFW
  • NumPy
  • Pillow (textures)

▶️ How to Run

pip install -r requirements.txt
python src/main.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published