diff --git a/src/main.rs b/src/main.rs index 231b339..b90d6b5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -159,15 +159,15 @@ fn three_balls_scene(aspect_ratio: f64) -> (Camera, HittableList) { let lookfrom = Point3::new(-2.0, 2.0, 1.0); let lookat = Point3::new(0.0, 0.0, -1.0); let vup = Vec3::new(0.0, 1.0, 0.0); - let dist_to_focus = 10.0; //(lookfrom - lookat).length_squared(); - let vfov = 20.0; + let dist_to_focus = (lookfrom - lookat).length(); + let focal_length_mm = 20.0; let defocus_angle = 0.0; let cam = Camera::new( lookfrom, lookat, vup, - vfov, + focal_length_mm, aspect_ratio, defocus_angle, dist_to_focus, @@ -184,7 +184,6 @@ fn main() { let samples_per_pixel: i32 = 200; let max_depth: i32 = 10; - // Camera and World let (cam, world) = random_scene(aspect_ratio); let num_threads: usize = match available_parallelism() { @@ -239,6 +238,3 @@ fn main() { img_buffer.save("render.png").unwrap(); } - -// print!("\r{} %", progress); -// let _ = stdout().flush();