summaryrefslogtreecommitdiff
path: root/src/common.rs
diff options
context:
space:
mode:
authorRosyid Haryadi <rosyid_haryadi@protonmail.com>2025-03-03 15:30:38 +0700
committerRosyid Haryadi <rosyid_haryadi@protonmail.com>2025-03-03 15:30:38 +0700
commitaf169d990391d3301fc1993a65816612d29cb5e1 (patch)
tree368440c4cd773c74ecd1b16f41ac72bedf95081f /src/common.rs
parentd1909a30fbe458286e8a4cff86951773a3c64e68 (diff)
upd camera focus
Diffstat (limited to 'src/common.rs')
-rw-r--r--src/common.rs3
1 files changed, 3 insertions, 0 deletions
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 }