COM1370 Computer Graphics
3D Assignment
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. You may draw these directly to a window on the screen or to a ppm file or both.
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. ***(Hearn & Baker 531-533)
- Add shading to your image using Lambert's Law for diffuse lighting. ***(Hearn & Baker 498)
- Add shadows cast on the view plane by following a ray from each visible back-plane pixel to the light source. ***(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
Friday, March 8, 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%)
Submit the following: