A rotating donut (torus) rendered using PyOpenGL with a Phong-shaded light inspired by jomatech's https://www.youtube.com/shorts/FIZI3k7mTvA
This project requires Python 3. It utilizes the following libraries:
PyOpenGLPyOpenGL_accelerateglfw(for window management)numpy(for numerical operations)PyGLM(for OpenGL mathematics)
The project is designed to run on both macOS (which uses MoltenVK for OpenGL compatibility) and Linux.
Built using Gemini CLI without a pro subscription, which probably means the slower / less reliable Gemini 2.5 Flash, but it was sufficient.
-
Clone the repository:
git clone https://github.com/your-repo/donut-phong.git cd donut-phong -
Create and activate a Python virtual environment (recommended):
python3 -m venv venv source venv/bin/activate # On macOS/Linux # venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
To run the application:
python3 main.pyThe donut will render, rotate, and soft-bounce within the window, adjusting for window resizing.
