CS 445 / 645 Introduction to Computer Graphics

Spring 2004

Assignment 2: Sutherland-Hodgman Clipping

Due: 5:00 Tuesday, February 24th

URL: http://www.cs.virginia.edu/~gfx/Courses/2004/Intro.Spring.04/ProgrammingAssignments/Exercise2

Synopsis

 Your program will load a polygonal object, clip the polygonal object with two clipping planes, and use OpenGL to render it.  You will write code to clip the model to the two arbitrary clipping planes using the Sutherland-Hodgman algorithm. Your FLTK/Boost/OpenGL program will provide debugging aids and an intuitive user-interface.  Grad students, note that your program must also support interactive repositioning of the clipping planes.

Relevant reading/files/software

Collaboration and Use of Materials on the Web

Unlike previous assignments for this course, you cannot use any graphics code related to clipping.  Code segments for the tasks in the assignment are probably floating around the web and it is inappropriate to use any of them.  As per the earlier assignments, you can still talk to your classmates about your work, but you cannot look at each other's code or work side-by-side to generate your code.  You can use outside resources to learn about OpenGL, FLTK, and Boost.

Specifics

We are providing a Visual Studio 7.1 Solution file and C++ skeleton files. The skeleton files will set up lighting so that front-facing polygons will be drawn one color and back-facing polygons another. You will modify the functions in the skeleton code, adding additional user interface widgets and core functionality.  Take full advantage of available C++ data structures to avoid making mistakes by reimplementing your own.  Some special things to notice about the code:

 Extra Credit