3080/GV10 Computer Graphics

You will find in this page a series of exercises that follow the lecture. Some exercises are here only for you to practice, but you will have to hand-in two courseworks that will be marked.

We encourage you to do the exercises in C++ as this is the most common language used in Computer Graphics. Learning it will provide you with a more complete knowledge. However, for those who feel they really can't, most of the exercises are also provided in Java. In the marking of the coursework, we will not mark bad use of the C++ language. We will concentrate on the appropriateness of the chosen algorithm.


Week 1,2 - Tutorial 1 (not assessed)

This objective this week is get familiar with OpenGL and the machines. It is a very important for the course. Also, you are encourage to bring your laptops to set up all the necessary environment variables that will be necessary for making the exercises of the course.

You can start with an exrcise to familiarise you with simple opengl programming. General information about OpenGL can be found here. For window management we will use GLUT which should already be installed on your machine. If you do need the libraries and header files, they can be downloaded from here.

Your task for this week is to take this simple 2D program, which opens a window and draws a triangle, and change it so that it draws something more interesting.


Week 1,2 - Exercise 2 (not assessed)

The purpose of this exercises this week is to familiarise you with ray casting. It is a very important exercise since you will need it for the first assessed coursework of this course.

You can find the information for the java program here.

You can find the information for the C++ program here.


Week 1,2,3 - Exercise 3 (not assessed)

This week we'll experiment with setting the 3D camera in opengl. In the program you were given in week 1 the viewing is to orthographic. This is parallel projection which makes the objects look flat. Try these steps:

0. If you haven't done it last week, change the line drawing to some 3D object. For example a cube. To do this you need to render each polygon individually by giving its vertices between a glBegin(GL_POLYGON) and a glEnd().

1. Change the viewing from orthographic to perspective. In opengl you don't need to explicitely give the viewing matrix for setting up the camera. You can use the functions gluLookAt() and gluPerspective(). The first one specifies where you are standing and which direction you are looking at as well the view up vector, while the second one defines the view volume and the near and far clipping planes.
Read the man pages or see in the other examples that we gave you how this is done. Tip: before calling gluPerspective() you need to set the matrix mode to projection using glMatrixMode(GL_PROJECTION) and before calling gluLookAt() set the matrox mode to modelview using  glMatrixMode(GL_MODELVIEW). See for example cube.c.

2. If you are still feeling keen you can make it interactive so that you can move the viewpoint using the mouse.

See also at the programming examples using GLUT


Week 3-4 Coursework 1 (Individual)(This coursework is ASSESSED)

Ray Tracing

For this coursework you need to implement an recursive ray tracer.

The coursework is described here .

You need to hand in a print out of your commented code (only yours with the context),  a short report refering to the technique you use - description of equations if necessary, the choice you made in your algorithm, and analysed results (you need to add pictures you produced to your report). 

Deadline Wednesday 29/10/2008 by 12pm


Week 5 - 7 - 8 Exercise 4 (not assessed)

(this was given as a coursework last year)

Boundary Representation

This coursework is designed to give you some practice in generating object representations. It also builds upon the exercises we've done in the last 2 weeks.

You have two tasks:

·  write a program that creates a boundary representation of an object by rotation, see here for the specification. The result of this program is the description of the object in terms of polygons. This can be either saved in a file (see example files here) or kept in an array and

·  render the object using openGL. (extra points will be given for interactive viewing (moving of the viewpoint with mouse))


Week 8-9-10-11 Coursework 2 (Individual) (This coursework is ASSESSED)

Radiosity question on Progressive Refinment Radiosity.

You need to hand in a print out of your commented code (only yours with the context),  a short report refering to the technique you use - description of equations if necessary, the choice you made in your algorithm, and analysed results (you need to add pictures you produced to your report). 

Deadline Friday 12/12/2008 by 12pm