Re-inventing the introductory computer graphics course: providing tools for a wider audience

4
1 For 1999}2000, the author's address is San Diego Super- computer Center, P.O. Box 85608, San Diego, CA 92186, USA. http://www.cs.csustan.edu/&rsc. E-mail address: rsc@eos.csustan.edu, rsc@sdsc.edu (S. Cunningham) Computers & Graphics 24 (2000) 293}296 Education Re-inventing the introductory computer graphics course: providing tools for a wider audience Steve Cunningham1 Computer Science Department, California State University Stanislaus, 801 West Monte Vista Avenue, Turlock, CA 95382 USA Abstract Traditionally, the introductory computer graphics course in computer science has focused on fundamental algorithms and techniques for creating images and animations. This was re#ected in ACM/IEEE Curriculum 91 (Tucker AB, Barnes BH. Computing curricula 1991: Report of the ACM/IEEE/CS Curriculum Task Force. New York: Silver Spring, MD: ACM Press/IEEE Computer Society Press, 1991). Computer graphics and similar subjects are expected to play a larger role in undergraduate computer science in the future (Cunningham S. SIGCSE Bulletin 1998;30(4):4a}7a), and this is being discussed in the ACM/IEEE Curriculum 2001 project. In the last few years the approach to teaching this course has changed to take advantage of more powerful graphics tools. This paper describes an approach to the introductory computer graphics course that increases its value as a tool for the student in the sciences, mathematics, or engineering as well as providing a sound introduction to the subject for the computer science student. This approach is compatible with the recommendations of the recent Graphics and Visualization Education Workshop (Reports of the Graphics and Visualization Education 99 workshop are published online at www.eg.org/WorkingGroups/GVE/GVE99 and www.education.siggraph.org/conferences/GVE99 and will appear in Computer Graphics and Computer Graphics Forum) while focusing on serving an expanded audience. ( 2000 Elsevier Science Ltd. All rights reserved. 1. Introduction Computer graphics has become an important tool for the working scientist, mathematician, and engineer. Its value is expanding as the sciences embrace visualization and as powerful computers become more and more commonly available, even on the desktop. However, the traditional computer graphics course focuses on funda- mental graphical algorithms and processes, and is oriented towards the computer science student who wants to pursue advanced work in the "eld, not the student in science, mathematics, or engineering. The graphics APIs now available allow us to refocus the "rst computer graphics course to place more empha- sis on computer graphics programming. Using a high-level API opens computer graphics to any student with strong programming skills, and o!ers computer science an opportunity to serve science, mathematics, and engineering students by developing an introductory computer graphics course with dual goals. One goal is to introduce computer science students to basic geometric processes, graphics programming, and the graphics pipe- line; the other is to give students in science, mathematics, and engineering a basic background in thinking and programming in 3D geometric terms. 2. Developing the course The goals of the class as described above must be implemented when the course is o!ered. The "rst goal, introducing computer science students to basic graphics concepts and to graphics programming, is straightfor- ward. We discuss the nature of modeling, of de"ning entities and their properties, of de"ning a scene, of view- ing, and of rendering. We add issues of event-driven 0097-8493/00/$ - see front matter ( 2000 Elsevier Science Ltd. All rights reserved. PII: S 0 0 9 7 - 8 4 9 3 ( 9 9 ) 0 0 1 6 4 - 8

Transcript of Re-inventing the introductory computer graphics course: providing tools for a wider audience

Page 1: Re-inventing the introductory computer graphics course: providing tools for a wider audience

1For 1999}2000, the author's address is San Diego Super-computer Center, P.O. Box 85608, San Diego, CA 92186, USA.http://www.cs.csustan.edu/&rsc.

E-mail address: [email protected], [email protected](S. Cunningham)

Computers & Graphics 24 (2000) 293}296

Education

Re-inventing the introductory computer graphics course:providing tools for a wider audience

Steve Cunningham1

Computer Science Department, California State University Stanislaus, 801 West Monte Vista Avenue, Turlock, CA 95382 USA

Abstract

Traditionally, the introductory computer graphics course in computer science has focused on fundamental algorithmsand techniques for creating images and animations. This was re#ected in ACM/IEEE Curriculum 91 (Tucker AB, BarnesBH. Computing curricula 1991: Report of the ACM/IEEE/CS Curriculum Task Force. New York: Silver Spring, MD:ACM Press/IEEE Computer Society Press, 1991). Computer graphics and similar subjects are expected to play a largerrole in undergraduate computer science in the future (Cunningham S. SIGCSE Bulletin 1998;30(4):4a}7a), and this isbeing discussed in the ACM/IEEE Curriculum 2001 project. In the last few years the approach to teaching this course haschanged to take advantage of more powerful graphics tools. This paper describes an approach to the introductorycomputer graphics course that increases its value as a tool for the student in the sciences, mathematics, or engineering aswell as providing a sound introduction to the subject for the computer science student. This approach is compatible withthe recommendations of the recent Graphics and Visualization Education Workshop (Reports of the Graphics andVisualization Education 99 workshop are published online at www.eg.org/WorkingGroups/GVE/GVE99 andwww.education.siggraph.org/conferences/GVE99 and will appear in Computer Graphics and Computer GraphicsForum) while focusing on serving an expanded audience. ( 2000 Elsevier Science Ltd. All rights reserved.

1. Introduction

Computer graphics has become an important tool forthe working scientist, mathematician, and engineer. Itsvalue is expanding as the sciences embrace visualizationand as powerful computers become more and morecommonly available, even on the desktop. However, thetraditional computer graphics course focuses on funda-mental graphical algorithms and processes, and isoriented towards the computer science student whowants to pursue advanced work in the "eld, not thestudent in science, mathematics, or engineering.

The graphics APIs now available allow us to refocusthe "rst computer graphics course to place more empha-sis on computer graphics programming. Using a

high-level API opens computer graphics to any studentwith strong programming skills, and o!ers computerscience an opportunity to serve science, mathematics,and engineering students by developing an introductorycomputer graphics course with dual goals. One goal is tointroduce computer science students to basic geometricprocesses, graphics programming, and the graphics pipe-line; the other is to give students in science, mathematics,and engineering a basic background in thinking andprogramming in 3D geometric terms.

2. Developing the course

The goals of the class as described above must beimplemented when the course is o!ered. The "rst goal,introducing computer science students to basic graphicsconcepts and to graphics programming, is straightfor-ward. We discuss the nature of modeling, of de"ningentities and their properties, of de"ning a scene, of view-ing, and of rendering. We add issues of event-driven

0097-8493/00/$ - see front matter ( 2000 Elsevier Science Ltd. All rights reserved.PII: S 0 0 9 7 - 8 4 9 3 ( 9 9 ) 0 0 1 6 4 - 8

Page 2: Re-inventing the introductory computer graphics course: providing tools for a wider audience

program design and of controlling programs with simpledevices such as the keyboard and mouse, and weintroduce simple animation. These are all supported bycurrent APIs, and the student develops skills inprogramming graphics applications while learning aboutgraphical concepts. This approach opens the beginninggraphics course to a wide variety of new students, asdescribed in Cunningham [1].

The second goal of supporting science, mathematics,and engineering students (abbreviated as `sciencea inthe remainder of the paper) is intended to give themthe graphics tools that they will need for their "elds[2]. As we describe later in this paper, the course willinclude projects that emphasize scienti"c concepts, sothese students will not only learn computer graphics, butwill also see how graphics can help them understandscience.

Adopting these two goals has another consequence. Byworking with science students on interdisciplinary pro-jects, computer science students will learn about com-munications and about the nature of applications. Eachproject will begin with a discussion about the underlyingscience and will close by asking for a conclusion aboutthe science; in between students will need to understandhow geometry is developed from a scienti"c problem,how that geometry is programmed to produce an imageor animation, and how the graphic results tell somethingabout the science. This in itself should be a valuableexperience for an upcoming computer scientist, and ofcourse is also the approach needed by the science stu-dent. The heterogeneous nature of the class o!ers oppor-tunity for small-group projects with diverse groups ofstudents, which can be challenging, but the bene"tsshould outweigh any problems this might bring.

In order to serve this diverse audience, the courseneeds to include a collection of examples and projectsthat come from a broad set of scienti"c areas. We needexamples and projects from mathematics, from physics,from chemistry, from biology, and from various branchesof engineering. Creating a set of materials with this broadcoverage will take some time, and the author has begunto work on such a project with the support of a grantfrom the National Science Foundation. These materialswill be developed and tested in collaboration with otherfaculty having many di!erent kinds of experience andwith students from other disciplines. We expect to havea draft set of materials available by mid-2000 and a com-pleted set a year from then. The materials will be distrib-uted on the Web and will evolve as our understanding ofthe needs of science students grows.

The course outline is straightforward. It begins with anintroduction to the concepts of geometry as used byOpenGL, and with simple examples of OpenGL pro-grams to help students see how to build their "rstprogramming projects. It goes on to cover basicpolygon-based modeling, including the use of instancing

transformations; to discuss rendering including projec-tions, viewing, lighting, and shading; and to work withevent handling to provide user controls and animation. Itends with some features that students rarely actually usein a traditional introductory course, such as alpha blend-ing, texture maps, and fog. All the work in the course isdone in 3D, with almost no reference at all to 2Dgraphics. The use of OpenGL as the basic API supportsboth goals for the course and is consistent with currentdirections in graphics applications.

This course is only possible because of advances inlow-cost and high-function graphics systems. Computerswith these capabilities are now accessible for evenbudget-strapped universities. Graphics programmingAPIs such as OpenGL and Java3D are readily usable bystudents who have programming skills but are not com-puting specialists. Further tools should soon be widelyavailable.

My students are enthusiastic about this kind of courseand my science colleagues are helping to assemblescience-related projects, expecting that their students willwant to take the course.

3. Course projects

A key to making this course e!ective for science stu-dents is creating a good set of projects that are meaning-ful to the student. We need projects that "t the students'scienti"c areas. The author is developing a set of projectsfor the course with this orientation, and plans to havea set ready to distribute by the start of the academic yearin 2000.

In the "rst course o!ering, however, we did not haveany of these projects. Instead, the course projects illus-trated simple modelings and renderings in the sequencein which materials are presented and in which studentswould develop their skills. These skills, however, provedto be signi"cant when the course provided good APIsupport. In the "rst o!ering, these projects were:

(a) create 3D histograms that rotate continually, withonly ambient light,

(b) model and render a physical object with one lightsource, where both the object and the light sourcecan be rotated using keystrokes,

(c) create and display a pseudo-fractal landscape withsemi-transparent water and both snow and treelines, adding menus to control aspects of the land-scape (Fig. 1),

(d) display a randomly chosen N-body gravity problemwith each body showing a short-term trace of itsrecent location, with time-step animation (Fig. 2),

(e) de"ne and display a BeH zier surface with selectableand moveable control points (Fig. 3).

294 S. Cunningham / Computers & Graphics 24 (2000) 293}296

Page 3: Re-inventing the introductory computer graphics course: providing tools for a wider audience

Fig. 1. Pseudo-fractal landscape with alpha blending in water.

Fig. 2. N-body problem with fade-out trails on bodies.

Fig. 3. BeH zier spline surface with control points shown; one isselected for movement.

Fig. 4. The process described by student projects.

Each of the projects included user-controlled motionsor some form of animation, and each rewarded thestudent for good modeling work by providing very re-warding images. Because each project also involved ani-mation and/or user interaction, however, these staticimages only hint at the quality of the work involved.

In the "rst "gure, students use keyboard callbacks tomove around the landscape and see it from di!erentviewpoints, and use menu callbacks to change variousfeatures of the landscape. In the second "gure, the bodiesmove in real time driven by the idle callback, usingsimulated gravitational forces between the multiplebodies. In the third "gure, students move around theshape with keyboard control and can select andmanipulate a control point with mouse callbacks anditem selection, as shown; the shape of the surface changesinteractively as the point is moved with keyboardcontrol.

In the full course, students will be able to choose theprojects they work on so that their projects come fromtheir own area of science. These projects will visualizeaspects of their science and will reinforce theirlearning in that area. At the current time the author isdeveloping the projects with the support of a grant fromthe National Science Foundation, and a "rst draft of theprojects should be available in the summer of 2000 at theauthor's Web site, http://www.cs.csustan.edu/&rsc.

The process the projects illustrate is straightforwardand is described in Fig. 4. In the student's area of science,we choose a problem and describe to the student howgeometric information may be developed from that prob-lem. This geometric information may be data vectors,may be an abstraction of reality, or may be an expressionof a piece of theoretical work, for example. The projectthen asks the student to use the graphics system to createan image based on that geometry, and "nally the studentis invited to draw a conclusion about the science(or about the problem in the science) from the image.

S. Cunningham / Computers & Graphics 24 (2000) 293}296 295

Page 4: Re-inventing the introductory computer graphics course: providing tools for a wider audience

This puts the students' work in computer graphics in thecontext of their understanding of science, giving an addedvalue to their programming work.

The language and systems used for projects is not anissue, though it happens that we use C or C## onMacintosh and NT systems. In the future we expect toconsider o!ering the course with APIs such as Java3D,depending on the availability of the systems and theamount of programming background needed to usethem. Being independent of the language and systems isvery important in making the course work for non-computer science students and cannot be overem-phasized in permitting students to create interesting anduseful images without using sophisticated programmingtechniques.

4. The sequel to this course

This approach to the course is very promising. At theend of the introductory course, students have learned tothink geometrically, to create programs that express theirgeometric thinking, and to write programs that imple-ment modest amounts of animation and interaction.They have seen an overview of the graphics pipeline, haveseen the e!ect and behavior of a number of graphicsprocesses, and have had a modest description of somegraphics algorithms, but have done little direct work withthose algorithms. This gives my computer science stu-dents an excellent background for tackling a secondgraphics course containing the traditional fundamentalalgorithms content.

As I teach it, the second course focuses on familiarfundamental techniques. This may be done in manyways, depending on the instructor's experience and thegoals of the students and the curriculum. These caninclude interpolation material such as scan-convertingpolygons, shading models, Z-bu!ering, texturing, andbump and environment mapping, as well as techniquessuch as antialiasing and ray tracing. With the experienceand the basic use of key concepts my students got fromthe "rst course, they were able to develop a good under-standing of more advanced graphics techniques and wereable to move quite quickly through material that hadpreviously been fairly di$cult.

The value of the traditional computer graphics prin-ciples course does not seem to be reduced by beginningcomputer graphics studies with this new kind of intro-ductory course. On the contrary, the combinationof an introductory course based on graphics API

programming and a subsequent fundamental principlescourse seems to be an excellent introduction to computergraphics content for computer science students. Addi-tional advanced courses can be developed as neededwhen additional topics need to be covered.

5. Summary

One of the challenges of computer science is to "ndways to serve our universities and still maintain thequality of our courses and programs. Because computergraphics is so useful to so many di!erent "elds, it isa natural course to take on a service role, but because thecourse has traditionally made signi"cant mathematicaland programming demands on its students, it has rarelybeen used in this way.

The approach outlined in this note o!ers us a way toprovide a course that bene"ts both the computer sciencestudent and the student from mathematics, science, orengineering. It is accessible to faculty, is useful to com-puter science students, opens the door to further studiesof more advanced computer graphics topics, and is avaluable service to other students whose professionallives will require continual use of computer graphics.And let's remember that when students have the oppor-tunity to do work that they enjoy and that means some-thing to them, the course is a lot of fun to teachand students really enjoy the high-quality work theyproduce.

Acknowledgements

This work is partially supported by National ScienceFoundation grant DUE-9950121. All opinions, "ndings,conclusions, and recommendations in this work are thoseof the author and do not necessarily re#ect the views ofthe National Science Foundation.

References

[1] Cunningham S. Powers of 10: the case for changing the"rst course in computer graphics. Proceedings of the ACMSIGCSE Technical Symposium on Computer Science Edu-cation, Austin, TX, March 2000.

[2] Brown JR, Cunningham S, McGrath M. Visualization inscience and engineering education. In: Nielson GM, ShriverB, editors. Silver Spring, MD: IEEE tutorial: scienti"c vis-ualization. IEEE Computer Society, 1990.

296 S. Cunningham / Computers & Graphics 24 (2000) 293}296