Skip to content

A rotating donut rendered using PyOpenGL with a Phong-shaded light

License

Notifications You must be signed in to change notification settings

jdonald/donut-phong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

donut-phong

A rotating donut (torus) rendered using PyOpenGL with a Phong-shaded light inspired by jomatech's https://www.youtube.com/shorts/FIZI3k7mTvA

Rotating donut with Phong shading

Requirements

This project requires Python 3. It utilizes the following libraries:

  • PyOpenGL
  • PyOpenGL_accelerate
  • glfw (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.

Installation

  1. Clone the repository:

    git clone https://github.com/your-repo/donut-phong.git
    cd donut-phong
  2. Create and activate a Python virtual environment (recommended):

    python3 -m venv venv
    source venv/bin/activate  # On macOS/Linux
    # venv\Scripts\activate   # On Windows
  3. Install dependencies:

    pip install -r requirements.txt

Usage

To run the application:

python3 main.py

The donut will render, rotate, and soft-bounce within the window, adjusting for window resizing.

About

A rotating donut rendered using PyOpenGL with a Phong-shaded light

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published