Gloobs - An Object-Oriented Environment for Teaching Graphics

Simon Myers Tony Jenkins
School of Computer Studies School of Computer Studies
University of Leeds University of Leeds
Leeds, Yorkshire, UK. Leeds, Yorkshire, UK.
Phone: +44 (0)113 233 5430 Phone: +44 (0)113 233 5768
FAX: +44 (0)8701 306 303 FAX: +44 (0)113 233 5468
Email: Smylers@stripey.com Email: tony@scs.leeds.ac.uk

Abstract

Gloobs is an object-oriented graphics development environment for teaching. It is based on the simple two-dimensional library, g2. It allows students familiar with C++ to learn graphical concepts without having to master a new programming language and paradigm at the same time.

Availability

Gloobs is available under the same licensing conditions as g2. You are welcome to use it for any non-profit purpose; we would very much appreciate an email if you choose to do so.

Gloobs is © Simon Myers and Tony Jenkins 1999, 2000.

Gloobs was developed on a Red Hat Linux platform. The source code may be downloaded. We can offer no support on installation or use. All the information is included in the Gloobs Guide and there are some Sample Programs. You will also need g2 and gd. Our C++ compiler-of-choice is g++.

Background

For a new degree programme, an introductory graphics module was needed. The target audience was students with no prior knowledge of the subject area, but who had successfully completed a course in object-oriented programming, in C++. The module was restricted to two-dimensional graphics, so that students can gain confidence with the basic principles of graphics without having to cope with the large amount of maths that is intrinsic to three-dimensional work.

The area of graphics fits well into object-oriented design methodology — first defining objects, then using the objects in images — and given the students’ background it seemed sensible to make use of this. An environment was required for the students to use to carry out practical work. Research uncovered these points:

Gloobs

It was decided to create a C++ interface to g2 for use in the module. This new library keeps g2’s simplicity while incorporating object-oriented principles, and is known as “Gloobs”.

There is a Gloobs::Canvas class; instances have a size and type (png, PostScript, X11) and methods are invoked to draw on the canvas. Each method corresponds exactly to a g2 function. This offers only a slight advantage over g2.

There also exists the Gloobs::Object container class which stores a collection of various primitive classes. This works as follows:

Objects created like this can then be drawn on a canvas, translated to any position and any size. This offers these advantages:

Use

Gloobs has now been used in the introductory graphics module. A collection of highly-commented example programs was written to demonstrate particular aspects of computer graphics; these were used as lecturing aids and for students to examine by themselves. A coursework exercise has been completed, with the students writing Gloobs programs to display graphical representations of election results; these were run dynamically, via CGI, to form part of a Web page.

Evaluation

The results produced by the students were impressive. Gloobs enabled them to master most of the basic graphical concepts within a language and, more importantly, a methodology with which they were familiar. The object-oriented nature of Gloobs made the creation of graphical representations of election results (using coloured seats in a representation of the chamber, for example) very straigntforward. Crucially, this also served to reinforce the usefulness of object-orientation in a practical application.

Summary

The authors believe that Gloobs is a sensible first library to use for introducing computer graphics, hiding complexity from students and enabling them to focus on the graphical aspects. Its support for object-oriented design provides a synergy with the methodology used in teaching C++. Gloobs was designed for pedagogical situations, and it is not envisaged that it will have applications elsewhere.

After Gloobs, the students moved on to using OpenGL, still in two dimensions. It was noticeable that many of their early difficulties related to the syntax and nature of OpenGL, rather than to pure graphical matters. The use of Gloobs had provided a highly effective introduction to graphics.

Gloobs is to be released to the community under the GPL.

Reference

[1] Milanovic L, Wagner H, g2 website, http://g2.sourceforge.net/


Valid HTML 4.0!