public void parseScene(String sceneFileName) throws IOException, RayTracerException
	{
		FileReader fr = new FileReader(sceneFileName);

		BufferedReader r = new BufferedReader(fr);
		String line = null;
		int lineNum = 0;
		System.out.println("Started parsing scene file " + sceneFileName);



		while ((line = r.readLine()) != null)
		{
			line = line.trim();
			++lineNum;

			if (line.isEmpty() || (line.charAt(0) == '#'))
			{  // This line in the scene file is a comment
				continue;
			}
			else
			{
				String code = line.substring(0, 3).toLowerCase();
				// Split according to white space characters:
				String[] params = line.substring(3).trim().toLowerCase().split("\\s+");

				if (code.equals("cam"))
				{
					_camera = new Camera(vectorFromParams(params, 0),
							vectorFromParams(params, 3),
							vectorFromParams(params, 6),
							Double.parseDouble(params[9]), Double.parseDouble(params[10]));
					System.out.println(String.format("Parsed camera parameters (line %d)", lineNum));
				}
				else if (code.equals("set"))
				{
					_settings = new Settings(colorFromParams(params, 0), 
							Integer.parseInt(params[3]), Integer.parseInt(params[4]));
					System.out.println(String.format("Parsed general settings (line %d)", lineNum));
				}
				else if (code.equals("mtl"))
				{
					Material material = new Material(colorFromParams(params, 0),
							colorFromParams(params, 3),
							colorFromParams(params, 6),
							Double.parseDouble(params[9]),
							Double.parseDouble(params[10]),
							Double.parseDouble(params[11]));
					_materials.add(material);
					System.out.println(String.format("Parsed material (line %d)", lineNum));
				}
				else if (code.equals("sph"))
				{
					Sphere sph = new Sphere(Double.parseDouble(params[0]),
							Double.parseDouble(params[1]),
							Double.parseDouble(params[2]),
							Double.parseDouble(params[3]),
							Integer.parseInt(params[4]));
					
					_spheres.add(sph);

					System.out.println(String.format("Parsed sphere (line %d)", lineNum));
				}
				else if (code.equals("pln"))
				{
					Plain pln = new Plain(vectorFromParams(params, 0), 
							Double.parseDouble(params[3]),
							Integer.parseInt(params[4]));
					_plains.add(pln);
					System.out.println(String.format("Parsed plane (line %d)", lineNum));
				}
				else if (code.equals("lgt"))
				{
					Light lgt = new Light(colorFromParams(params, 0), 
							vectorFromParams(params, 3),
							Double.parseDouble(params[6]),
							Double.parseDouble(params[7]),
							Double.parseDouble(params[8]));
					_lights.add(lgt);
					System.out.println(String.format("Parsed light (line %d)", lineNum));
				}
				else
				{
					System.out.println(String.format("ERROR: Did not recognize object: %s (line %d)", code, lineNum));
				}
			}
		}

                // It is recommended that you check here that the scene is valid,
                // for example camera settings and all necessary materials were defined.

		System.out.println("Finished parsing scene file " + sceneFileName);

	}