Assignment 3 Camera Simulation

Name

Date submitted: ?? May 2006

Code emailed: ?? May 2006

Compound Lens Simulator

Description of implementation approach and comments

Well, the implementaiton consisted of 4 parts:

1) Reading in the file. After learning how to use c++ streams this wasn't too bad at all. My main issue that cost me coutless hours is that the file is BACKWARDS from what I thought it was. We always trace rays from the camera, so naivly I thought that is how the file would be set up. Woe was me :) Thanks for the help Tarang! I created a lensSphere object that holds the center of the sphere, its radius, n, previous n, and apature size. This handles the intersection too.

2) Sampling the back lens. Not too hard.

3) Sphere interesection. This wasn't working for the longest time. I know how to use the Quadratic function properly so I did the quadratic formula myself. Thanks grade 12 math.

4) Snell's Law. I did this 3 ways. First I tried to rotate about the cross product of the ray and the normal by the correct angle. Didn't work. Then I found a paper on the vector form of snell's law. Worked. Then I found something on wikipedia, which also worked.

My images are still kinda funky. I have spent countless hours on this, in addition to the 1.5 hours that Kayvon and I spent fix them, but to no avail. If anyone has any ideas as to why there is some transparency in the middle and sides of my image please let me know!

Final Images Rendered with 512 samples per pixel

My Implementation

Reference

Telephoto

hw3telephoto_512

Double Gausss

hw3dgauss_512

Wide Angle

hw3wide_512

Fisheye

hw3fisheye_512

Final Images Rendered with 4 samples per pixel

My Implementation

Reference

Telephoto

hw3telephoto_4

Double Gausss

hw3dgauss_4

Wide Angle

hw3wide_4

Fisheye

hw3fisheye_4

Experiment with Exposure

Image with aperture full open

Image with half radius aperture

Observation and Explanation

This should be stopping down by 2 F numbers. This should correspond to an image with 1/4 of the brightness, since the apature is 1/4 the area. Interestingly we only get about a 1/2 reduction in brightness. 13.57% of the rays passed through instead of the usual 27.58%. This is because the original apature didn't block many rays at all, the apature of the lenses did most of the blocking. If we stop down from the 8.55 radius I expect to get 1/4 of the rays through. And drumroll please... 4.02% of the rays go throught. Here is the pic:

Autofocus Simulation

Description of implementation approach and comments

Well, this is not going well. I'm using the operator that is given in the paper, and it is fall monotonically as I move away from the lens. Here is a plot of the standard deviation of all the focus operator with step size 1 (3x3 grid) over the whole window.

Final Images Rendered with 512 samples per pixel

Adjusted film distance

My Implementation

Reference

Double Gausss 1

mm

blank300x300

hw3afdgauss_closeup

Double Gausss 2

mm

blank300x300

hw3afdgauss_bg

Telephoto

mm

blank300x300

hw3aftelephoto

Any Extras

...... Go ahead and drop in any other cool images you created here .....