A comprehensive educational resource covering Python programming fundamentals to cutting-edge 3D graphics techniques, including real-time ray tracing and machine learning integration.
This repository contains a complete Python & 3D Programming Book - a comprehensive learning resource that takes you from Python basics to advanced 3D graphics programming. With 30 chapters, 120+ working examples, and 90,000+ lines of code, this book provides a complete learning path for anyone interested in 3D graphics programming with Python.
- ๐ Complete Learning Path: From Python fundamentals to cutting-edge 3D techniques
- ๐ฎ Real-World Examples: Practical 3D graphics applications and games
- โก Modern Techniques: Real-time ray tracing, machine learning integration, and advanced rendering
- ๐ ๏ธ Production-Ready Code: All examples are functional and well-documented
- ๐ Cross-Platform: Works on Windows, macOS, and Linux
- ๐ Comprehensive Documentation: Detailed explanations and usage guides
- ๐ง Professional Setup: GitHub Actions, issue templates, and contribution guidelines
- Chapter 1: Introduction to Python - Basic syntax, 3D demos, data processing
- Chapter 2: Variables, Data Types, and Operators - 3D coordinates, mathematical operations
- Chapter 3: Control Flow - Scene iteration, event handling, game logic
- Chapter 4: Functions and Lambdas - 3D math functions, reusable components
- Chapter 5: Data Structures - Scene graphs, object management, nested data
- Chapter 6: Object-Oriented Programming - 3D object classes, inheritance, polymorphism
- Chapter 7: Exception Handling - Error recovery, logging, robust applications
- Chapter 8: Modules, Packages, and File I/O - Project organization, scene serialization
- Chapter 9: Functional Programming - Pure functions, 3D transformations, higher-order functions
- Chapter 10: Iterators and Generators - 3D data streaming, procedural generation
- Chapter 11: Decorators and Context Managers - Performance timing, resource management
- Chapter 12: Working with External Libraries - NumPy, OpenGL, library integration
- Chapter 13: Concurrency and Parallelism - Threading, multiprocessing, async programming
- Chapter 14: Testing and Debugging - Unit testing, debugging tools, performance profiling
- Chapter 15: Advanced 3D Graphics Libraries and Tools - Library comparison, performance profiling
- Chapter 16: 3D Math Foundations - Vectors, matrices, quaternions, coordinate systems
- Chapter 17: Camera and Projection Concepts - Camera systems, projection types, view frustum
- Chapter 18: Transformations - Matrix transformations, hierarchies, coordinate systems
- Chapter 19: Scene Graphs and Object Hierarchies - Scene management, spatial organization
- Chapter 20: Basic Lighting Models - Lighting fundamentals, shading techniques, optimization
- Chapter 21: Texturing and Materials - Texture management, material systems, UV mapping
- Chapter 22: Shaders and GLSL Basics - Vertex/fragment shaders, GLSL programming, custom effects
- Chapter 23: Modern OpenGL Pipeline - VBOs, VAOs, uniform buffers, rendering pipeline
- Chapter 24: Framebuffers and Render-to-Texture - Post-processing, reflections, advanced effects
- Chapter 25: Shadow Mapping and Lighting Effects - Shadow mapping, multiple light sources
- Chapter 26: Normal Mapping, Bump Mapping, and PBR - Physically-based rendering workflows
- Chapter 27: Particle Systems and Visual Effects - Particle systems, visual effects, GPU processing
- Chapter 28: Simple Ray Tracing and Path Tracing - Ray tracing fundamentals, global illumination
- Chapter 29: Advanced Rendering Techniques - Deferred rendering, post-processing effects
- Chapter 30: Cutting Edge Graphics Techniques - Real-time ray tracing, machine learning in graphics
- Python 3.8 or higher
- OpenGL-compatible graphics card
- Basic understanding of programming concepts
-
Clone the repository:
git clone https://github.com/michaelgermini/python-3d-programming-book.git cd python-3d-programming-book -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
Each chapter contains multiple Python files with practical examples:
# Navigate to a specific chapter
cd part1_python_fundamentals/ch01_introduction
# Run an example
python hello_world.pyfrom part4_advanced_3d_techniques.ch30_cutting_edge_graphics_techniques.real_time_ray_tracing import HybridRenderer
# Create a hybrid renderer with hardware acceleration
renderer = HybridRenderer(800, 600)
renderer.setup_ray_tracing()
renderer.render_scene()from part3_introduction_to_3d_in_python.ch16_3d_math_foundations.vector_operations import Vector3D
# Create and manipulate 3D vectors
v1 = Vector3D(1.0, 2.0, 3.0)
v2 = Vector3D(4.0, 5.0, 6.0)
result = v1 + v2
magnitude = result.magnitude()from part4_advanced_3d_techniques.ch27_particle_systems_and_visual_effects.particle_system import ParticleSystem
# Create a particle system
particle_system = ParticleSystem()
particle_system.add_emitter(position=(0, 0, 0), emission_rate=100)
particle_system.update(delta_time=0.016)- Python 3.8+ - Core programming language
- OpenGL - Modern graphics programming
- NumPy - Numerical computing and mathematics
- PyOpenGL - Python OpenGL bindings
- GLSL - Shader programming
- Real-time Ray Tracing - Hardware-accelerated rendering
- Machine Learning - AI-powered graphics techniques
- Particle Systems - Visual effects and simulations
- Physically-Based Rendering (PBR) - Realistic materials
- Post-Processing Effects - Screen-space effects and filters
- GitHub Actions - Automated testing and CI/CD
- Pytest - Testing framework
- Black - Code formatting
- Flake8 - Code linting
python-3d-programming-book/
โโโ part1_python_fundamentals/ # Python basics (8 chapters)
โ โโโ ch01_introduction/
โ โโโ ch02_variables/
โ โโโ ...
โโโ part2_advanced_python_concepts/ # Advanced Python (6 chapters)
โ โโโ ch09_functional_programming/
โ โโโ ch10_iterators_and_generators/
โ โโโ ...
โโโ part3_introduction_to_3d_in_python/ # 3D foundations (6 chapters)
โ โโโ ch16_3d_math_foundations/
โ โโโ ch17_camera_and_projection_concepts/
โ โโโ ...
โโโ part4_advanced_3d_techniques/ # Advanced 3D (10 chapters)
โ โโโ ch21_texturing_and_materials/
โ โโโ ch22_shaders_and_glsl_basics/
โ โโโ ...
โโโ appendices/ # Reference materials
โ โโโ appendix_a_environment_setup.md
โ โโโ appendix_b_math_reference.md
โ โโโ appendix_c_troubleshooting_guide.md
โโโ .github/ # GitHub templates and workflows
โโโ requirements.txt # Python dependencies
โโโ pyproject.toml # Modern Python configuration
โโโ README.md # This file
Start with Part I and work through each chapter sequentially. Each chapter builds upon the previous ones with practical 3D examples.
You can skip to Part II or Part III depending on your Python and graphics experience.
Focus on Part IV for cutting-edge 3D techniques and advanced graphics programming.
- Part I: Python Fundamentals (Chapters 1-8)
- Part II: Advanced Python Concepts (Chapters 9-14)
- Part III: Introduction to 3D in Python (Chapters 15-20)
- Part IV: Advanced 3D Techniques (Chapters 21-30)
- Part III: Introduction to 3D in Python (Chapters 15-20)
- Part IV: Advanced 3D Techniques (Chapters 21-30)
- Part II: Advanced Python Concepts (Chapters 9-14)
- Part IV: Advanced 3D Techniques (Chapters 21-30)
- Real-time 3D rendering with OpenGL
- Particle systems for visual effects
- Shadow mapping and advanced lighting
- Post-processing effects and filters
- Physically-based rendering workflows
- 3D game engines and frameworks
- Physics simulations and collision detection
- Character animation and skeletal systems
- Level design and scene management
- Performance optimization techniques
- Data visualization in 3D space
- Volume rendering for medical imaging
- Mathematical modeling and simulations
- Interactive 3D plots and charts
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Bug reports and fixes
- New examples and tutorials
- Documentation improvements
- Performance optimizations
- Feature requests and implementations
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenGL Community - For excellent graphics programming resources
- Python Community - For the amazing programming language and ecosystem
- Graphics Research Community - For advancing the state of real-time rendering
- Open Source Contributors - For the tools and libraries that make this possible
If you have any questions or need help:
- ๐ง Email: michael@germini.info
- ๐ Issues: GitHub Issues
- ๐ Documentation: Check the individual chapter README files
- ๐ฌ Discussions: GitHub Discussions
- 30 Chapters covering complete learning path
- 120+ Working Examples with practical implementations
- 90,000+ Lines of code and documentation
- 4 Major Parts from basics to advanced techniques
- 3 Appendices with reference materials
- Professional Setup with CI/CD and community guidelines
Ready to dive into the world of Python and 3D graphics programming? Start your journey with this comprehensive resource:
git clone https://github.com/michaelgermini/python-3d-programming-book.git
cd python-3d-programming-book
pip install -r requirements.txtโญ If you find this book helpful, please give it a star! โญ
Happy coding and 3D programming! ๐ฎโจ