A camera is nothing in a raytracer except a source of rays. The camera logic should be extracted from the main parsing loop and placed in a class. This will allow other implementations of cameras to be loaded at runtime, such as fish-eye and orthographic cameras.