= Assignment 3 Camera Simulation = == Hyun Gu Lee == == Date submitted: ?? May 2006 == == Code emailed: ?? May 2006 == == Compound Lens Simulator == === Description of implementation approach and comments === It is said that one does not feel the passage of time when one engages in an activity that is enjoyable. I, for some reason, did not feel the passage of time while working on this assignment :-? . While I won't go into every little mistake that has kept me from finishing this, I will give a broad overview of what I did. First, off in the camera constructor, I build and store the data structure for the lens surfaces. I also calculate useful variables here such as total thickness of all lenses, length of each side of the film, and Area of back lens over film distance squared. In GenerateRay, I find convert the given imageX and imageY coordinates from raster to camera coordinates. After calling ConcentricSampleDisk, I compute the camera coordinates of the sampled point on the back lens. By using these two points, I get the initial ray direction and origin. It is "important" to remember to normalize this initial ray direction if vector form of Snell's law is used later on. The ray then goes through each lens surface. If the current surface is actually a aperture stop, a ray-plane intersection is performed. The distance from the intersection point to the z-axis is computed. If this is larger than the given aperture, this ray is blocked, so we return. For other lens surfaces, the intersection is computed using ray-sphere intersection. This code is heavily borrowed from pbrt. After the intersection point is computed, its distance from the z-axis is compared to the aperture. Again, if the ray is outside the aperture of the lens, we return. Now, we compute the new ray direction using the vector form of Snell's law. (Much easier to use!). We check for internal reflection, then continue with the loop. After we're done going through all the lens surfaces, the ray is converted to World coordinates. We do some housekeeping with various ray members, then compute the weight for irradiance calculation. I've also coded up a ray visualization during my hours of frustration. It wasn't very helpful because of the nature of my bugs/stupidity :-? I wrote it using OpenGL, slightly modifying some test code I wrote for some other project. attachment:ray.jpg [[BR]] === Final Images Rendered with 512 samples per pixel === || || '''My Implementation''' || '''Reference''' || || '''Telephoto''' ||http://graphics.stanford.edu/courses/cs348b-06/homework3/blank300x300.jpg|| http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.telephoto_512.png|| || '''Double Gausss''' ||attachment:hw3.dgauss.jpg||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.dgauss_512.png|| || '''Wide Angle''' ||http://graphics.stanford.edu/courses/cs348b-06/homework3/blank300x300.jpg||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.wide_512.png|| || '''Fisheye''' ||attachment:hw3.fisheye.jpg||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.fisheye_512.png|| === Final Images Rendered with 4 samples per pixel === || || '''My Implementation''' || '''Reference''' || || '''Telephoto''' ||http://graphics.stanford.edu/courses/cs348b-06/homework3/blank300x300.jpg|| http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.telephoto_4.png|| || '''Double Gausss''' ||http://graphics.stanford.edu/courses/cs348b-06/homework3/blank300x300.jpg||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.dgauss_4.png|| || '''Wide Angle''' ||http://graphics.stanford.edu/courses/cs348b-06/homework3/blank300x300.jpg||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.wide_4.png|| || '''Fisheye''' ||http://graphics.stanford.edu/courses/cs348b-06/homework3/blank300x300.jpg||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.fisheye_4.png|| == Experiment with Exposure == || '''Image with aperture full open''' || '''Image with half radius aperture''' || || http://graphics.stanford.edu/courses/cs348b-06/homework3/blank300x300.jpg || http://graphics.stanford.edu/courses/cs348b-06/homework3/blank300x300.jpg || === Observation and Explanation === ...... == Autofocus Simulation == === Description of implementation approach and comments === ...... === Final Images Rendered with 512 samples per pixel === || || '''Adjusted film distance''' || '''My Implementation''' || '''Reference''' || || '''Double Gausss 1''' || __ mm || http://graphics.stanford.edu/courses/cs348b-06/homework3/blank300x300.jpg || http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.afdgauss_closeup.png|| || '''Double Gausss 2''' || __ mm || http://graphics.stanford.edu/courses/cs348b-06/homework3/blank300x300.jpg ||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.afdgauss_bg.png|| || '''Telephoto''' || __ mm || http://graphics.stanford.edu/courses/cs348b-06/homework3/blank300x300.jpg ||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.aftelephoto.png|| == Any Extras == ...... Go ahead and drop in any other cool images you created here .....