From ea0e4d78415a7876803b6c83e3b95aade2d999b9 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 28 Oct 2021 20:08:25 +0300 Subject: fix: use camera brightness --- src/camera.rs | 4 ++-- src/main.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/camera.rs b/src/camera.rs index 8768ace..8409ea5 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -9,7 +9,7 @@ use std::time::Instant; type Vector = Vector3; -pub const HEIGHT: i32 = 60; +pub const HEIGHT: i32 = 50; pub const WIDTH: i32 = HEIGHT * 3; #[derive(Debug)] @@ -154,7 +154,7 @@ impl Camera { let mut dist = 0.0; let mut count = 0; - while dist < 8.0 && count < 10 { + while dist < self.brightness && count < 10 { count += 1; dist = self.sdf(point); if dist.abs() < threshold { diff --git a/src/main.rs b/src/main.rs index aa5a456..e0b0fd9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,7 @@ fn main() { angle: PI / 2.0, distance: 1.0, aspect_ratio: 2.0 * HEIGHT as f32 / WIDTH as f32, - brightness: 5.0, + brightness: 15.0, time: 0.0, speed: 0.5, turn_rate: 30.0, -- cgit v1.2.3