From ba78b90209c5fd3a183043ad3f5110c4a60bf335 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 27 Oct 2021 21:16:29 +0300 Subject: feat: control camera with VIM keys --- src/camera.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/camera.rs') diff --git a/src/camera.rs b/src/camera.rs index 9f22e99..4773a81 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -91,21 +91,14 @@ impl Camera { return dist } - pub fn rorate_around_point(& mut self, point: Vector) { - let rotations_per_round = 2.0; - self.position = rotate_z(self.position - point, rotations_per_round * 2.0 * PI / 60.0) + point; - self.direction = (point - self.position).normalize(); - } - pub fn screen(&self) -> (f32, f32) { let width = self.distance * 2.0 * (self.angle / 2.0).tan(); let height = width * self.aspect_ratio; // println!("Screen {}x{} units", width, height); (width, height) } - pub fn render(& mut self) { - self.rorate_around_point(Vector { x: 4.0, y: 0.0, z: 0.0 }); + pub fn render(& mut self) { let palette = "$@B%8&WM#oahkbdpqwmZO0QLCJUYXzcvunxrjft/\\|()1{}[]?-_+~<>i!lI;:,\"^`'. "; let (screen_width, screen_height) = self.screen(); -- cgit v1.2.3