2017 February 20,

CS 311: Computer Graphics

Carleton College, Winter 2017

Prof. Joshua R. Davis, , Laird 207A, x4095


This is a first course in computer graphics. Our goal is to understand the fundamental theory and methodology underlying contemporary video games, movies, scientific visualizations, etc. To that end, the course proceeds in three stages:

  1. We implement a 3D graphics engine in C. We begin with a minimal hardware interface that lets us make a window and set individual pixels to specified colors. Atop this primitive foundation we implement triangle rasterization, texture mapping, scene graphs, projections, lighting, etc.
  2. We re-write our graphics engine using one or more hardware acceleration paradigms. Definitely we use shaders (OpenGL 2.x-4.x). As time permits we also study lower-level interfaces (Vulkan) and fixed-function interfaces (OpenGL 1.x).
  3. We pursue projects, solo or in pairs, to investigate other topics. Some projects add advanced features to the existing engine. Others study alternative rendering paradigms such as ray tracing or voxels.

The only prerequisite for this course is CS 201: Data Structures. We need some specific content from that course, such as stacks and graphs. More importantly, students must have maturity in thinking algorithmically and learning on their own. Students are expected to learn C and basic linear algebra such as multiplying matrices. I provide tutorials to teach the essentials of these subjects, but I do not spend much class time on them.

Our class meets in CMC 209 during period 5A (MW 1:50-3:00, F 2:20-3:20). My office hours are MonWedFri 6A and Thu 1:00. Of course, appointments can be made too. The best appointment times for me are TueThu 9:30.


Exam A and its Solutions. Percentiles were 75th = 41.5, 50th = 38.5, 25th = 35.5, out of 48 possible points.

First Half of our course schedule. It lists lecture/discussion topics briefly and homework in detail. I provide you with many files through its links.

Second Half of our course schedule.

Project details and ideas.

Technical Issues helps you install the software required for this course.

OpenGL Programming Guide (9th Edition) by Kessenich, Sellers, Shreiner. This textbook is optional, not required. One copy of this book is on reserve in the library. The 9th Edition covers OpenGL 4.5, but much or all of our work in this course will use OpenGL 2.1, and the two are not compatible. So I do not strongly recommend purchasing the 9th Edition.

OpenGL Programming Guide (8th Edition). Covers OpenGL 4.3, as a PDF.

OpenGL Programming Guide (2nd Edition). Covers OpenGL 1.1, in HTML.

Official OpenGL Documentation has been useful to me.


Final grades (A, B, C, etc.) are assigned according to an approximate curving process. By this I mean that there are no predetermined percentages (90%, 80%, 70%, etc.) required for specific grades. The following elements contribute to the final grade.

You are expected to spend at least 10 hours per week on this course outside class. Some students need to spend more than 10 hours. If you find yourself spending more than 15 hours, then talk to me.

Working with Others

For some assignments the students are expected to work in pairs. Your pair hands in a single copy of the assignment with both names on it. You are encouraged to talk with other pairs — to bounce ideas off them — but the work that you submit must be the work of your own pair. The two members of a pair must contribute roughly equally.

Other assignments may be individual. Even on these assignments, you are encouraged to talk with other students. In the end, however, you write or type your own solution, in your own words.

You may not copy someone else's work or allow them to copy yours — in person, over the Internet, etc. Presenting someone else's work as your own is an act of academic dishonesty. If Carleton College finds that you have not upheld its Academic Integrity standards in this course, then you will receive an F for this course.

Special Accommodations

If some medical condition affects your participation in class or your taking of exams, let me know in the first week of class. You may also need to make official arrangements with the Disability Services for Students.

In most courses that I teach, homework is collected weekly. I declare a "one free late pass" policy. Students can hand in any one assignment a week late, with no questions asked. In this course, however, homework happens nearly every day, and each day's lecture/discussion and homework builds on the preceding day's. You must keep up with the homework.

So here is the tentative policy for this course: If you cannot complete a homework assignment on time, then you must talk to me, in person, on the due date. I reserve the right to change this policy.


We use OpenGL/Vulkan because, unlike Direct3D and Metal, it is a non-proprietary industry standard available for many operating systems. In theory, all of our software can be compiled and executed on any recent computer running Windows, macOS, various flavors of Linux, etc.

In practice, I supply instructions for compiling and running our software in macOS on the lab machines in CMC 306 and CMC 304. You are welcome to program on your own computer, but you will have to set it up yourself. Mike Tie in CMC 305 might or might not be able to help you. In any case, your code will be graded under macOS on the lab machines. So be sure that it runs correctly there.

We program in C for three reasons. First, graphics requires speed, and C produces fast programs. Second, C is the native language for communicating with OpenGL. Third, every advanced computer science student should know C.