Chapter 2. Computer Graphics with the GEM Library

In this chapter, we will proceed with the Graphics Environment for Multimedia (GEM) library to work with computer graphics. We will start with the basics to create the GEM display window for graphics. Within the window, we will learn to draw 2D and 3D primitive shapes. We will understand the coordinates system in GEM in order to apply geometric transformations to the graphical shapes and also learn to enhance the surfaces of the graphical shapes with color information. Furthermore, we will learn to apply the lighting information to produce more realistic images. By the end, we should be able to produce a simple animation in 3D space.

GEM is an external library for the Pure Data software. It is available at http://gem.iem.at. Nevertheless, the version of Pure Data (pd-extended) we are using already includes the GEM library. We will use the GEM library to create both 2D and 3D graphics from scratch.

The topics that we are going to cover in this chapter are:

  • Using the GEM display window
  • Drawing basic 2D graphics
  • Understanding the coordinates system
  • Drawing basic 3D graphics
  • Working with digital color
  • Applying geometric transformations
  • Creating animation in 3D space

To get general help and tutorials for GEM, you can also use Help Browser to check out the material: