# Assignment 3 Camera Simulation

## 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 sin. 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. Kayvon and I spend 1.5 hours trying to 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 Double Gausss Wide Angle Fisheye

### Final Images Rendered with 4 samples per pixel

 My Implementation Reference Telephoto Double Gausss Wide Angle Fisheye

## Experiment with Exposure

 Image with aperture full open Image with half radius aperture

......

## Autofocus Simulation

......

### Final Images Rendered with 512 samples per pixel

 Adjusted film distance My Implementation Reference Double Gausss 1 mm Double Gausss 2 mm Telephoto mm

## Any Extras

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