Computer Graphics (CS4300) 2012F: Assignment 6
DUE: 9pm, November 28, 2012
Worth: 10% of your final grade
Goals
- understand ray tracing
- implement Lambertian diffuse and Phong specular shading
- render shadows
Assignment
In this assignment, you will generate a realistic image of a 3-dimensional scene composed of spheres floating between you and the view plane. You will use ray-tracing and a local illumination model to generate your image.
General description
- Your program should be able to handle at least 5 spheres. Each sphere is given by its center (cx, cy, cz), its radius, and its color (R, G, B), diffuse and specular coefficients, kd and ks, and specular exponent e.
- The positions of the viewer and the single point source of light are each given by coordinates, e.g. (vx, vy, vz) and (Lx, Ly, Lz).
- The information for your scene must be read in from an input file.
- Use the methods presented in class to determine the RGB color of each pixel in your image. You may draw these directly to a window on the screen or to a ppm file or both.
Develop your program in these stages.
- Generate a flat image using only ambient light. This way you will know that your program is finding the spheres before you go on to work on shading and shadows.
- Add shading to your image using Lambert's Law for diffuse lighting.
- Add shadows cast on the view plane by following a ray from each visible back-plane pixel to the light source.
- Add shadows cast on the spheres by following a ray from a visible point on a sphere to the light source.
- Add Phong highlights on the spheres.
- Make the viewplane visible (i,e, not black) and add shadows cast on the view plane by following a ray from each visible back-plane pixel to the light source.
- Extra credit possibilities:
- multiple lights
- colored lights
- reflective objects (recursive ray-tracing)
- Gouraud shading (Compute the color at each vertex and use barycentric coordinates to blend the values.)
See Building a Ray Tracer - Page One for sample images. Note that the small images on that page are links to larger images.
Grading
These grading guidelines will be used for all programming assignments:
Your project will be graded on:
- correctness (60%).
- style of your program (10% )
- documentation:
-
- inline comments (10%)
- README (10%)
- quality of the resulting image(s). (10%)
Turn In
- all sourcecode for your project
- data files for up to 3 scenes
- a README.txt file as instructed in the submitting instructions.
Follow these instructions for packing up your project and submitting it.
Grading
Your project will be graded on:
- correctness (60%)
- style of your program (10% )
- documentation and inline comments (10%)
- README (10%)
- quality of the resulting image(s). (10%)
Some points may be subtracted (up to 10%) if you need substantial help from the professor to make your program run.
Harriet Fell
College of Computer Science, Northeastern University
360 Huntington Avenue #WVH-340,
Boston, MA 02115
Phone: (617) 373-2198 / Fax: (617) 373-5121
The URL for this document is: http://www.ccs.neu.edu/home/fell/CS4300/HW/HW6.html