You need to type commands in the console terminal (you need to run the console terminal as administrator):
pip install GLFW pip install PyOpenGL pip install Pyrr pip install NumPy
Pyrr - for trigonometry and linear algebra
NumPy - for special arrays for OpenGL functions
You will see how to use these libraries in video tutorial below.
Now you are ready to create simple games in Python and OpenGL. See this video tutorial about basics of OpenGL. You can start from the second lesson: Modern OpenGL programming in Python - part 02 - creating a GLFW window
After studying of this tutorial you can rewrite a prototype of the Snake 2D Tutorial: Python Snake Game from deprecated/legacy OpenGL 1 to modern OpenGL 3 and make it 3D with textures and lighting. And you will be able to load 3D models from Blender because the video tutorial above covers loading 3D models from Blender.
How to create an empty window using GLFW:
- Copy the file below ("main.py")
- Place glfw3.dll (glfw3.dll.zip) with "main.py"
- Run the application. For this run the command in the console terminal:
python main.py
main.py
import glfw def main(): # Initialize glfw if not glfw.init(): return window = glfw.create_window(800, 600, "My OpenGL Window", None, None) if not window: glfw.terminate() return glfw.make_context_current(window) while not glfw.window_should_close(window): glfw.poll_events() glfw.swap_buffers(window) glfw.terminate() if __name__ == "__main__": main()