stay tuned to the newsgroup for hints, e.g. pitfalls to avoid. ------------------------------------------------------------------------------- Computer Graphics Homework 5 CS417/CS418 Fall 1998 Due Wednesday, March 17, 1999 + Hand in each question SEPARATELY. + Make sure your names are LEGIBLE and EASILY SPOTTED on the front page of each question. (Highlighting/circling helps.) + You will be graded on correctness and also clarity and conciseness. + E-mail how many total hours PER PERSON you spent on this homework by midnight, Sunday, March 21. Feedback is also always appreciated. ############################## CS417 part ################################### Write a function RAYTRACE that ray-traces multiple spheres and light sources using item & light buffers. Assume spheres are disjoint. Continue using orthographic projection from above. Arrange your code as described below. NOTE: Matlab allows you to define local functions. If you place code for multiple functions sequentially into a file, only the first is visible to the outside world, but the other functions may call one another. 0. Rename DRAWSPHERES to RAYTRACE and incorporate the following. Use the versions of DRAWSPHERES, RAYSPHERE, and RAYSPHERES posted with this homework. 1. Write a function MAKEBUFFER. Continue to use pixels spaced 1 unit apart in world space and use orthographic projection from above. NOTE: Eliminate unnecessary parameters and unnecessary code (all the color computations should go away from this function). 2. Add an item buffer to RAYTRACE. 3. Add ray-tracing of reflection (use kr=ks) to RAYTRACE. Limit recursion to a user-specified depth. NOTES: + Use straightforward loops to loop over every pixel! + On recursive calls, be sure to avoid testing the current sphere! Turn in: + Hard-copy listing of the final version of your code. + Electronic copy of your code (details to come). + Printout of a rendering of the complicated test scene. Two test scenes to come -- for now, add r = round(r / 2.1); after r is defined in the old test scene to eliminate intersection and speed things up. ################################# CS418 part ################################## 4. Add light buffers (one for each light) to RAYTRACE. Since MAKEBUFFER expects to look down upon its scene, you'll need to use a matrix Tview and its inverse (inv(Tview)) to be able to call MAKEBUFFER and to use the result. 5. (Bonus) Base your item/light buffer code in question 1 on the fancy version of drawspheres. Add ray-tracing for transmission (transparency), using new parameters kt: coefficient of transmission/transparency eta: index of refraction