Skip to content

Python code repository of all OpenGL chapters from the book and its accompanying website https://learnopengl.com

License

Notifications You must be signed in to change notification settings

Zuzu-Typ/LearnOpenGL-Python

 
 

Repository files navigation

learnopengl.com code repository (Python version)

Python translation of the popular LearnOpenGL's source code and exercise repository. Currently chapters 1-6 have been completely translated.

The translation is very close to the original C++ source code, which makes it easy to use alongside the tutorial. It's partially machine translated. Please create an issue if you notice any mistakes, incorrect requirements or wrong formatting.

Most examples should run right out of the box, as they install the PyPI requirements automatically from the respective requirements.txt. Python 3.9+ is required.

Getting started

You can find the examples in the src folder.
You may want use them alongside LearnOpenGL.com.
To run the first example you simply need to run src/1.getting_started/1.1.hello_window/hello_window.py.

Here are some screenshots of the examples (one from each chapter):

Chapter 1, Exercise 5.1

Chapter 1

Chapter 2, Exercise 6

Chapter 2

Chapter 3, Exercise 1

Chapter 3

Chapter 4, Exercise 10.3

Chapter 4

Chapter 5, Exercise 8.1

Chapter 5

Chapter 6, Exercise 2.2.1

Chapter 6

Troubleshooting

NumPy related error

If you get an error related to numpy when running one of the examples, make sure to install version 1.26.4:

pip install numpy==1.26.4

Other errors

If an example does not run out of the box, please make sure the required packages are installed. This should happen automatically, however, this project uses an old version of my requirements installer, which might not work correctly on all platforms. If you suspect that required packages are missing, please take a look at master_requirements.dat and install the packages listed there.

Otherwise, feel free to open a new issue.

About

Python code repository of all OpenGL chapters from the book and its accompanying website https://learnopengl.com

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 41.2%
  • C++ 36.2%
  • Python 20.2%
  • GLSL 2.3%
  • Objective-C 0.1%
  • CMake 0.0%