University of Calgary, CPSC 453
Assignment 4


Date: Monday , November 22, 2010

Due date: Saturday, December 11, 2010 @ 11:59 pm

Total Marks: 100 marks + 30 bonus

Weight of this assignment: 25%

General Description

Write a recursive ray tracer.  For ray tracing, you need to create an image of a scene including several objects and models. You may specify the scene in the code and output the resulting image to a file or to the screen. The type of image file you use is your choice but the user must be able to specify the desired width and height of the resulting image through the command line or an input file.

Basic (90 marks)

  1. Objects in the scene: Spheres (15 Marks),  Triangles and quads (20 Marks)

  2.  Phong lighting model and point light sources with dynamic positions (20 Marks)

  3. Shadows (15 Marks)

  4. Reflection (recursive) (20 Marks)

To receive the marks of 1, you need to implement at least one of the 2, 3 and 4 features..

Bonus (maximum 30 marks)

         Read scene and light specification from an input file (5 Marks)

         Dynamic eye position and viewing direction specification (5 Marks)

         Refraction (recursive) (10 Marks)

         Simple anti-aliasing as discussed in class (5 Marks)

         Using your surfaces from assignment 2 in the scene (5 Marks for surface of revolution,  5 Marks for B-spline surfaces)

         Using triangle mesh in MD2 format in the scene (5 marks)

         Animated MD2 (a sequence of images generated by ray-tracing) (5 marks)

         Add other primitives such as cones, or implicit surfaces (5 marks each, up to 15 marks)

         OpenGL interface to create and preview the scene for ray-tracing.  This interface should include controls to position, orient, and scale objects within the scene (10 marks)

 Due to speed issues for ray-tracing, along with your code and documentation you must submit at least three images produced by your ray-tracer.  Your submitted images must show that each of the features (and bonuses) that you implemented work properly. You will not receive marks for features that are not demonstrated in the images you submit. You must also include a README file that describes the images you submit and which features are demonstrated in each image. It is up to you to decide on an output file format. You may use QT’s QImage to write the image to disc and display it, or you may display it in OpenGL and capture the screen to be saved on disk.  Another alternative is that you may use an existing library for bitmap format such as .png, .bmp, .pcx  or .ppm to save the output.  For example, PPM is a very simple format and its specification along with a library to read and write PPM files can be found here.  

Documentation (10 Marks)

You must provide a README:

  • your name and login id and email address,
  • outline of the algorithms, data structures, and design decisions,
  • description for  features of submitted images

Source Code

  1. All your source code must be written in C/C++. Your source code must compile on the lab machines in MS 239 without any special modifications. Your source code must be clear and well commented.
  2. You are allowed to reuse source code that: (a) has been provided by the instructor or the TAs for use in the course, (b) has been written by you that implements basic data structures, such as linked lists or arrays, (c) you have received permission from the instructor or one of the TAs of CPSC 453 prior to handing-in your assignment. Other sources are not acceptable for reusing.  You are not allowed to share your written code.
  3. Any instances of code reuse by you for this assignment must be explicitly mentioned within the README.pdf file. Failure to do so will result in a zero in the source code part of the assignment.