= Assignment 3 Camera Simulation = == Shradha Budhiraja == == Date submitted: 05 May 2006 == == Code emailed: ?? May 2006 == == Compound Lens Simulator == === Description of implementation approach and comments === The lens simulator works on the basic principles of refraction through glass. At first, it was important to convert the raw image coordinates given by the sample to appropriate camera coordinates. Samples on the lens were taken by using the sample->lensU/lensV and passing it to the concentricSampleDisk. These determined the original direction of the ray. This was used to calculate cos(theta) for the weight of the ray. The next step was to perform the sphere-ray intersections as the ray passes through each lens in stack. This was done by simply plugging the equation of a ray (o + td) into the equation of a sphere and solving the quadratic in t. If the intersection point is beyond the aperture, the ray does not make it to the world. The ray now had to be refracted through the lens using snell's law. I first tried rotating the ray by the new angle found through snell's law. After a lot of debugging, I realised this was not going to work. Searching through the internet, I found a paper which found the direction of the refracted ray in a more sophisticated manner. I used the method described in the paper to calculate the direction of the ray. If this direction had inverted, it was a case of total internal reflection and the ray was ignored. === Final Images Rendered with 512 samples per pixel === || || '''My Implementation''' || '''Reference''' || || '''Telephoto''' ||attachment:hw3.telephoto_512.png|| http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.telephoto_512.png|| || '''Double Gausss''' ||attachment:hw3.dgauss_512.png||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.dgauss_512.png|| || '''Wide Angle''' ||attachment:hw3.wide_512.png||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.wide_512.png|| || '''Fisheye''' ||attachment:hw3.fisheye_512.png||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.fisheye_512.png|| === Final Images Rendered with 4 samples per pixel === || || '''My Implementation''' || '''Reference''' || || '''Telephoto''' ||attachment:hw3.telephoto_4.png|| http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.telephoto_4.png|| || '''Double Gausss''' ||attachment:hw3.dgauss_4.png||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.dgauss_4.png|| || '''Wide Angle''' ||attachment:hw3.wide_4.png||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.wide_4.png|| || '''Fisheye''' ||attachment:hw3.fisheye_4.png||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 || attachment:hw3.afdgauss_closeup.png|| http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.afdgauss_closeup.png|| || '''Double Gausss 2''' || __ mm ||attachment:hw3.afdgauss_bg.png||http://graphics.stanford.edu/courses/cs348b-06/homework3/hw3.afdgauss_bg.png|| || '''Telephoto''' || __ mm ||attachment:hw3.aftelephoto.png||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 .....