ABSTRACT

Developing complex interactive three-dimensional scenes requires writing programs that make use of a computer’s graphics processing unit (GPU). OpenGL is the most widely adopted cross-platform application programming interface enabling developers to write GPU programs. To facilitate working with OpenGL, this chapter takes the first steps in developing an OpenGL-based graphics framework with Python, a programming language acclaimed for its accessibility and versatility. A series of increasingly complex examples are presented, beginning with rendering a point, followed by rendering lines and triangles with a single color. Advanced examples feature drawing multiple shapes with multiple colors, creating a series of animations involving movement and color transitions, and implementing interactive applications with keyboard controlled movement. At each stage, classes are developed to simplify the underlying programming tasks involved.