COM3370 Computer Graphics
Assignment 1
Introduction
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 from 1 to 5 spheres. It is not any harder to
add more spheres but it will take more time to run. Each sphere is given by its
center (x, y, z), its radius, and its color (R, G, B).
- The positions of the viewer and the single point source of light are each given by
coordinates (x, y, z).
- The information for your scene should be read in from an input file.
- Use the methods presented in class to determine the RGB color of each pixel in your
image. Store these in a ppm format file and view the result with XV3.
Develop your program in four 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. ***(Watt 18-19 Hearn & Baker 531-533)
- Add shading to your image using Lambert's Law for diffuse lighting. ***(Hearn & Baker 498, Watt 173-179, 342-345)
- Add shadows cast on the view plane by following a ray from each visible back-plane pixel to the light source. ***(Watt 345-347 Hearn & Baker 529-530)
- Finally, add shadows cast on the spheres by following a ray from a visible point on a sphere to the light source.
See Building a Ray Tracer - Page One
for sample images. Note that the small images on that page are links to larger images.
Due
By midnight Tuesday, July 10 2001.
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%)
Some points may be subtracted (up to 10%) if you need substantial help from the professor to make your program run.
The penalty for a late homework is 5% per calendar day for up to one week late.
No homework will be accepted later than that.
Turn in:
- your source code. Your code should be well organized and commented.
- a makefile, if necessary.
- a README file containing:
- your name, the date, and the assignment number
- a list of the files in the folder with comment for each explaining its purpose
- instructions on how to run your program
- a description of any bug that you have not been able to fix. A documented bug will not cost you as much as an undocumented one.
- Please do NOT email ppm files or executable code. I will generate them from your source code.
Harriet Fell
College of Computer Science, Northeastern University
360 Huntington Avenue #161CN,
Boston, MA 02115
email: graphics@harrietfell.com
Phone: (617) 373-2198 / Fax: (617) 373-5121
Last Updated: June 12, 2001 2:15 pm
The URL for this document is:
http://www.ccs.neu.edu/home/fell/COM3370/COM3370prog1.html