All Projects → fogleman → Pg

fogleman / Pg

Licence: mit
Python OpenGL Graphics Framework

Programming Languages

python
139335 projects - #7 most used programming language

pg: The Python Graphics Framework

pg is a lightweight, high-level OpenGL graphics framework for Python. It is a work in progress.

Tutorial

A basic tutorial is available here:

http://pg.readthedocs.org/en/latest/tutorial.html

Features

Many OpenGL applications have a lot of features in common, but there's a lot of boilerplate involved when using OpenGL. This high-level framework lets you focus on your application-specific functionality instead.

  • shaders
    • compile and link
    • attributes and uniforms
    • built-in shaders for common use-cases
  • vertex buffers
    • optionally interleaved
  • matrices
    • translate, rotate, scale
    • perspective and orthographic projections
    • transpose, determinant, inverse
  • textures
  • geometric shapes
    • sphere, cuboid, plane, cylinder, cone, axes
  • models
    • .obj and .stl file formats
  • WASD movement
    • built-in!
  • windowing and input
    • glfw-based
    • multiple windows

Dependencies

brew tap homebrew/versions
brew install glfw3
pip install Pillow PyOpenGL

Examples

Clone the repository and run main.py to see these and several other examples.

3D Pipes: pipes.py

Screenshot

Gusev Crater: gusev.py

Screenshot

OBJ and STL Models: suzanne.py

Screenshot

Constructive Solid Geometry (CSG): csg.py

Screenshot

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].