From af169d990391d3301fc1993a65816612d29cb5e1 Mon Sep 17 00:00:00 2001 From: Rosyid Haryadi Date: Mon, 3 Mar 2025 15:30:38 +0700 Subject: upd camera focus --- src/common.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/common.rs') diff --git a/src/common.rs b/src/common.rs index 69f9a48..3f111ec 100644 --- a/src/common.rs +++ b/src/common.rs @@ -18,6 +18,9 @@ pub const LOOK_FROM: Point3 = Point3 { x: -2.0, y: 2.0, z: 1.0 }; pub const LOOK_AT: Point3 = Point3 { x: 0.0, y: 0.0, z: -1.0 }; pub const VUP: Vec3 = Vec3 { x: 0.0, y: 1.0, z: 0.0 }; +pub const DEFOCUS_ANGLE: f32 = 10.0; +pub const FOCUS_DIST: f32 = 4.0; + pub const fn get_image_height(image_width: usize, aspect_ratio: f32) -> usize { let image_height = (image_width as f32 / aspect_ratio) as usize; if image_width < 1 { 1 } else { image_height } -- cgit v1.2.3-70-g09d2