To generate realistic-looking images using ray tracing.
You will be supplied with a program (a modification of Assignment 2) that reads a data file and displays it using OpenGL. When you click in the window, another window will appear, in which a ray traced version of the scene should be displayed. You will write the code to ray trace this scene.
Your program should handle all of the geometry of the input file (spheres, polygons, meshes, ambient and point light sources). As described below, the supplied program transforms the scene to be a tree and have all of the objects specified in world coordinates (ie. the groups will all have the identity transformation). This means that your eyepoint is at the origin, looking along the z-axis, and the viewplane is centered on the z-axis. You will use the perspective parameters to determine the rays through the pixels on the viewplane.
You program should compute colors using the local illumination model we discussed in class earlier in the semester. It should also generate shadows, but does not need to handle transparency or reflection (these are extra credit).
All of the files for the assignment are in ~cs4451/a5-files
Your program should consist of a set of java files which should be commented with your name (the name you are registered under!) and ID number. One of the java files should implement a class "A5" (so the TA can execute it using the command "java A5".) The files should be emailed as attachments to a single email message to cs4451@cc.gatech.edu.
You should ray trace at least one image of moderate complexity at a resolution of at least 300 by 300 and save the image to a publicly accessible web page (use snapshot to capture it, and then xv to convert it to GIF so that it doesn't use up so much disk space, or have your program save it as a gif when it finishes rendering). Include a URL for the web page in the header comments of the files you turn in. The web page should contain the image and any other comments you feel are necessary. The data file to create this image should be included in your submission. We will provide some samples input files, which you can use or modify as you wish.
The time the mail is received will be used to determine whether or not the program is late, so be sure to allow a couple of minutes for the mail system to transmit your file if you are working right up to the deadline.
IMPORTANT: If the TA has to edit your files you will lose points. Similarly, the TA should be able to execute the class "A5", so using any other class as your main class will result in lost points.
This program is due on or before Monday, December 4th. This means it must be received by 11:59pm EDT on Monday to not be considered late. GRADUATING SENIORS ARE NOT ALLOWED TO TURN IN THE ASSIGNMENT LATE.
The input file is similar to assignment 2. There is one significant difference, which is the material properties on cubes, polygons, meshes and spheres. Instead of the "r g b" values from assignment 2, these objects now have the following seven parameters:
red green blue Kd Ks Shine T index_of_refraction
As before, RGB are in the range of 0.0 to 1.0.
Kd is the diffuse component, Ks the specular, Shine is the Phong cosine
power for highlights, T is transmittance (fraction of contribution of the
transmitting ray). Usually, 0 <= Kd <= 1 and 0 <= Ks <= 1, though it is
not required that Kd + Ks == 1. Note that transmitting objects ( T > 0 )
are considered to have two sides for algorithms that need these (normally
objects have one side).
Also, when you are looking at the provided code, please keep in mind that the following things:
Your task will be to implement the function "public Color ShootRay(int x, int y)" in the file RayTraceWindow.java. The window has the world coordinate version of the scene graph that can be used inside ShootRay. A suggested way to implement the ray tracer is to implement the function "public abstract Hit intersectRay (Vertex origin, Vertex dir, SpaceObject root)" on each of the scene objects, and put whatever information you need in the returned "Hit" object that this function returns (for example, the color, object hit, and t-value of the intersection along the ray might all be useful).
The window size is passed to the RayTraceWindow when it is created. You should keep it small while debugging (ray tracing is slow), but increase it when you are generating images you are happy with.
Finally, the provided program is adapted from one of the sample solutions to assignment 2. Feel free to change it as you want, although you should not need to.
The following options can be added for extra credit. You will receive extra credit for each option you implement, which may exceed the 2 possible point total that could be obtained in the previous assignments (each option will be worth 1 or 2 points):
In all cases, be sure that you have a README file that describes the enhancement(s), as well as instructions on how to invoke them or show them off. For example, you should include sample input files that demonstrate your features. For speedup options, you should be able to enable or disable them from the command line, so the TA can observe the speed differences.
Note: you should NOT worry about any of these until you have implemented the basic functionality of the program--the required parts!