Computer Science 102 Major Program 1 Due 20 February 11:59PM Adhere to the following programming standards. Violations will lead to deductions. (1) no function should be longer than 30 lines code + whitespace. (2) the maximum nesting level in any function is ONE (3) code lines should not extend beyond column 72 (4) no more that one statement may be written on a single line (5) use reasonably descriptive names for variables and functions (6) your program should compile without any warnings with gcc -Wall (7) indenting should be consistent with logical nesting (8) diagnostic / debug prints should be disabled in your submission. For this asssignment you will complete the ambient-lighting only raytracer that supports infinite plane, tiled-plane and sphere type objects, and you will build your own model description file, mymodel.txt that demonstrates your program works correctly in a technically interesting and artistic way. New functions that must be written include: Module Functions ------- camera.c camera_setpix() camera_write_image() image.c image_create() make_row() make_pixel() ray.c raytrace() find_closest_object() material.c material_getamb() tplane.c tplane_init() tplane_getamb() tplane_dump() For testing START WITH A SINGLE plane. When that works, add a second plane. Then go back a do a single sphere, then add a second sphere. Then mix spheres and planes. Some sample input/outputs are in the mp1 directory. They should be tested in the order: mp1a mp1b,.... mp1f. ONLY when all of that works add the tiled plane. DO NOT submit broken or incomplete components!!! A submission that correctly produces the image on page 22 will get an 80. A submission that correctly produces the image on page 22 along with an incorrect sphere and an incorrect tiled plane will score somewhere between 60 and 70. Grading regimen --------------- Functionality Max score One plane 75 Two planes or more 80 Two planes + two spheres 90 Two planes + two spheres + 100 tiled_plane Finally create and turn in your own model file named mymodel.txt. You will find that the most interesting pictures (e.g. the "snowman") can be produced by using intersecting and overlapping objects and letting the ray tracer do its job of showing only the visible parts. Too many planes of quasi random orientation can create something of a mess, so please avoid that. The model should also have enough depth along with properly chosen ambient intensities that varying brightness provides visible depth cues. Particulary meritorious model designs can earn up to 10 points extra credit. Its best to carefully layout spheres that intersect planes and each other. A good size for your image is 800 x 600 pixels. The turn in directory is mp1 and as usual your program should build an executable program named a.out when you say "make" and when I say "make". The image file should go to the standard output. THIS IS NOT THE SAME AS IN CPSC 101. To run the program enter the command: a.out < mymodel.txt 1> mymodel.ppm 2> mymodel.log