bild
Skolan för
datavetenskap
och kommunikation
KTH / CSC / Courses / DH2323 / dgi12 / Labs

Computer Graphics with Interaction, dgi12

The practical part of the course will be examined through three obligatory labs in the form of programming exercises and an optional project in order to achieve one of the higher grades.

For those who wants to run things on their own computer, without installing a C++ compiler and the SDL-library, we have prepared a Virtual Machine to run under VirtualBox. As it is rather big (4GB) we are seeding it as a torrent for now.

If you want to code on your own Windows machine you can follow these instructions to setup Visual Studio and SDL.

Download and make sure that once you have passed a lab that the TA signs this reciept. If we somehow manage to forget that you have passed a lab this is your proof.

Introductory lab - 30th of March

In this short lab you will familiarize yourself with the programming frame work used in this course. You will use the programming language C++ and the libraries SDL and GLM to plot pixels on the screen. This is the basic operation for all computer graphics programming. In the later labs you will use this basic operation to draw 3D scenes. The aim of this lab is to learn:
  • Basic C++ programming.
  • How images are represented as pixels in the memory of the computer.
  • How you can draw pixels on the screen using SDL.
  • How colors can be represented on the computer.
  • What linear interpolation is and how to interpolate quantities like color.
  • Programming a state machine.
  • Pinhole camera
The final result of this lab will be a C/C++ program that generates images similar to those seen in figure below.

A detalied description of the lab can be found here and the skeleton program here

Raytracer - 20th of April

In this lab you will implement a Raytracer, which draw images of 3D scenes by tracing the light rays reaching the simulated camera. The lab is divided into two parts. In the first part you will learn:
  • How to represent a 3D scene using triangular surfaces.
  • How a pinhole camera can be represented mathematically.
  • How to trace the ray of each pixel in the camera image into the scene.
  • Computing ray-triangle intersections, to find out which surface a particular ray hit.
  • How to move the camera around using the keyboard.
The result of the first part of the lab should be a C++ program that draws the image seen in figure \ref{}. In the second part of the lab you will extend this program by also modelling:
  • Light sources.
  • Reflection of light for diffuse surfaces.
  • Shadows (direct).
The final result of the lab should be a C++ program that draws the image seen in the figure below.

A detalied description of the lab can be found here and the skeleton program here

Rasterizer - 11th of May

In this lab you will implement a Rasterizer to draw images of 3D scenes. The output of the Rasterizer will be very similar to the Raytracer you wrote in Lab 2, but a Rasterizer achieves this in a different way. It is typically faster than a Raytracer and thus more suitable for real-time graphics. The lab consists of two parts. In the first part you will explore:
  • Projection of 3D points by a pinhole camera.
  • Drawing 3D objects modeld by triangular surfaces by first projecting the vertices of the triangles to the 2D image plane.
  • Using linear interpolation to draw triangles in 2D.
  • Use a depth buffer to check visibility for each pixel.
The first part of the lab produces something very similar to the first part of lab 2, but faster. In the second part you will extend the program by also implementing:
  • Light sources.
  • Interpolation of arbitrary quantities across the triangle: light, normal, position, texure coordinates.
  • Per vertex and per pixel illumination.
The final result of the lab should be a C++ program that draws the image seen in the figure below.

A detalied description of the lab can be found here and the skeleton program here

Optional assignment a.k.a. "The Project" or Lab 4

In order to acquire one of the higher grades (A,B) on the course you need to make an optional assignment. You are completely free to choose the assignment yourself but you should discuss with the lecturers in order to define something that is relevant. The result of a potential project is shown below which is implementing a global illumination model for rendering the cornell box.


In order to present project please sign up for one timeslot in the doodle following this link URL
Copyright © Sidansvarig: Carl Henrik Ek <chek@csc.kth.se>
Uppdaterad 2012-05-24