Skip to content

maxomous/PyGLViewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyGLViewer

A Python-based 3D Viewer & GUI.

Overview

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

Controls

  • 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

Installation Instructions

1. Install Visual C++ Build Tools

2. Install PyGLViewer

pip install git+https://github.com/maxomous/pyglviewer.git

Note: It installs the following packages:

- numpy
- PyOpenGL
- PyOpenGL_accelerate  # optional 
- glfw
- imgui[glfw]

3. For ImGui Docking Branch (Alternative)

git clone --recurse-submodules https://github.com/pyimgui/pyimgui.git
cd pyimgui
git checkout docking
pip install .[glfw]

4. ImGui Intellisense (Optional)

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:

Usage

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.

About

3D Viewer & GUI written with OpenGL for Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages