diff --git a/src/main.rs b/src/main.rs index 7556afa..8bea18f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -171,7 +171,6 @@ fn random_world() -> HittableList { } fn from_obj(path: &str) -> HittableList { - let mut world = HittableList::new(); let material_ground = Arc::new(Lambertian::new(&Color::new(0.05, 0.05, 0.05))); @@ -216,30 +215,31 @@ fn from_obj(path: &str) -> HittableList { Point3::new( mesh.positions[3 * index_a] as f64, mesh.positions[3 * index_a + 1] as f64, - mesh.positions[3 * index_a + 2] as f64 + mesh.positions[3 * index_a + 2] as f64, ), Point3::new( mesh.positions[3 * index_b] as f64, mesh.positions[3 * index_b + 1] as f64, - mesh.positions[3 * index_b + 2] as f64 + mesh.positions[3 * index_b + 2] as f64, ), Point3::new( mesh.positions[3 * index_c] as f64, mesh.positions[3 * index_c + 1] as f64, - mesh.positions[3 * index_c + 2] as f64 + mesh.positions[3 * index_c + 2] as f64, ), - material.clone() + material.clone(), ))); } } return world; - } // The output is wrapped in a Result to allow matching on errors // Returns an Iterator to the Reader of the lines of the file. fn read_lines
(filename: P) -> io::Result