Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Python-based OpenGL application demonstrating 3D primitive animations

Notifications You must be signed in to change notification settings

seigtm/pyopengl-primitives-animation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenGL Primitives Animation

A Python-based OpenGL application that demonstrates 3D primitive animations with transformation effects.

Features

  • Two interactive scenes with different 3D primitives
  • Smooth animations between states
  • Keyboard controls for scene interaction
  • Singleton pattern for scene management
  • Clean separation of concerns (window management, rendering, scene management)

Requirements

  • Python 3.x
  • PyOpenGL
  • PyOpenGL-accelerate (optional, but recommended)

Installation

Optional: Virtual Environment Setup

It's recommended to use a virtual environment:

# Create virtual environment
python -m venv venv

# Activate virtual environment
# On Windows:
.\venv\Scripts\Activate.ps1
# On Unix or MacOS:
source ./venv/bin/activate

Install Dependencies

pip install -r requirements.txt

Usage

Run the application:

python main.py

Controls

  • Spacebar: Toggle animation between scenes
  • First scene: Cube with expanding sphere
  • Second scene: Tetrahedron and rotating torus

Project Structure

  • main.py - Application entry point
  • src/
    • window.py - GLUT window management
    • renderer.py - OpenGL rendering logic
    • scene_manager.py - Scene state and animation control
    • config.py - Configuration constants
    • colors.py - Color definitions

Documentation

Detailed explanation of how this application works (in Russian) can be found in docs/detailed_explanation_ru.md.

About

Python-based OpenGL application demonstrating 3D primitive animations

Topics

Resources

Stars

Watchers

Forks

Languages