PyOpenGL Documentation Collection

PyOpenGL Documentation

General Background 

OpenGL under Python is largely the same as OpenGL under most other languages, so you can use much of the documentation you'll find around the Internet, or in your local bookstore.  This page primarily provides links to PyOpenGL-specific documentation.  Users of OpenGLContext should also see the OpenGLContext documentation page.

References

These documents tend to be focus on the particular APIs and details of operation for PyOpenGL (or OpenGL in general).

OpenGL Programming Guide (Red Book)

An older version of the official OpenGL Programming Guide, a.k.a "The Red Book" is available online (this is version 2.0, which covers OpenGL 1.1).  If you are serious about learning OpenGL, the newer versions of the Red Book, (v3.0) is likely on the shelves of your local bookstore, and is quite readable.

You'll find versions of some of the Red Book tutorial code for Python included in the OpenGL/Demo/redbook directory of the PyOpenGL distribution.  These versions are very close to the original source code.  The OpenGLContext tests directory also has four of the tutorials converted, "alpha", "alpha3D", "surface" and "trim".

Addison-Wesley Pub Co; ISBN: 0201604582 ; 3rd edition (August 6, 1999)

NeHe Tutorials

When people think of an "OpenGL tutorial", many will immediately think of the NeHe tutorials by Jeff Molofee, available at http://nehe.gamedev.net/ these tutorials range from the very simple (create an OpenGL window) through the advanced (particle systems, loading scenes from various formats, displaying video textures, text, morphing, multi-texturing).

The NeHe tutorials are so popular that there are multiple Python translations available:

  • Included with PyOpenGL, in the Demo directory you'll find a subdirectory NeHe, which includes translations of tutorials 1 through 6, with a multi-texturing version of tutorial 6 as well.  These translations are very close in their approach to the original tutorial's approach in terms of their structure and organization.  As a result, they can be somewhat hard to follow as Python code unless you are following along with the tutorial text and reading the reasoning behind the C code.
  • PyGame-specific versions by Paul Furber.  These are tightly coded direct translations of the NeHe code, idiomatic (function-oriented) Python.  Tutorials 1 through 10 are available.
  • Included with OpenGLContext, in the tests directory, you'll find a number of files named nehe*.py, these are, as you might expect, translations of the corresponding tutorials.  These translations are results-focused, they do not follow the tutorial's structure, instead they use best (object-oriented) practices in Python programming, and particularly OpenGLContext programming without completely violating the idea of  the tutorials (they try to keep the executed code in a single file, with minimal external dependencies). Tutorials 1 through 8 are translated, with the glprint.py test being a loose translation of tutorial 13 (bitmapped text). The OpenGLContext documentation collection includes the source online, with brief discussions of the differences from the tutorial code.
  • The NeHe tutorials themselves link to (very old) translations which very closely followed the original tutorial structure.  These tutorials served as the base for the versions in the PyOpenGL distribution.  I would not recommend using them for learning PyOpenGL.

Resources and Links

Here are some starting points for further exploration.

  • OpenGL.org -- The official home of OpenGL on the World Wide Web, includes extensive links to documentation, specifications, and companies involved with OpenGL.
  • GameTutorials.com -- introductory, slowly-building tutorials, similar to the NeHe tutorials
  • OpenGL.org's tutorials collection
  • LightHouse3D Tutorials -- intermediate tutorials on various OpenGL-related subjects
  • Gamasutra -- professional-level tutorials, often on "cutting edge" subjects, generally well-written and easily followed code, note that a free registration is required for much of the content, also see their publisher's site, Gamedev.net, which has a decent resources section

Support

Bug reports and feature requests should use the SourceForge project page.  General questions are best answered on the PyOpenGL mailing list.

A SourceForge Open-Source Project:
SourceForge
PyOpenGL