CSU540 Computer Graphics
Ray-Tracing Project
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 (cx, cy, cz), 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, e.g. (vx, vy, vz) and (Lx, Ly, Lz).
- 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. ***(Shirley 10.1-10.3)
- Add shading to your image using Lambert's Law for diffuse lighting. ***(Shirley 9.1)
- Add shadows cast on the view plane by following a ray from each visible back-plane pixel to the light source. ***(Shirley 10.5)
- Finally, add shadows cast on the spheres by following a ray from a visible point on a sphere to the light source. ***(Shirley 10.5)
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%)
Submit the following: