A Python-based 3D Viewer & GUI.
PyGLViewer handles the boilerplate code of OpenGL, GLFW, and ImGui, to allow you to quickly build 3D applications. It includes:
- OpenGL 3.3+ context creation and management
- GLFW window setup and event handling
- ImGui setup and rendering pipeline
- Camera system (orbit, pan, zoom) implementation
- Pre-configured shader system with lighting
- Left/middle click + drag: Rotate camera
- Ctrl + left/middle click + drag: Pan camera
- Scroll wheel: Zoom in/out
- WASD: Move camera
- Left click: Select object (2D mode only)
- ESC: Exit application
- Download from: Visual Studio Build Tools
- Select "Desktop development with C++"
pip install git+https://github.com/maxomous/pyglviewer.git
- numpy
- PyOpenGL
- PyOpenGL_accelerate # optional
- glfw
- imgui[glfw]
git clone --recurse-submodules https://github.com/pyimgui/pyimgui.git
cd pyimgui
git checkout docking
pip install .[glfw]
Intellisense is not included in the current version of the 'imgui' due to it being a port from C++, you can manually add it by:
- Download from: https://github.com/masc-it/pyimgui-interface-generator/blob/master/imgui.pyi
- Save to: AppData\Roaming\Python\Python312\site-packages\imgui_init_.pyi
See the examples folder for usage examples.
example_2d.py
gives a simple example of how to use the library in 2D.example_3d.py
gives a more complete example of how to use the library in both 2D and 3D.