From f7e6dec079dcbbc26a9e047cf2b0acf23c091836 Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Fri, 17 Jul 2026 14:25:30 -0700 Subject: add Transformation::look_at() now we have real camera behavior. yay! Force-Push: yes Change-Id: I291d0cce0f2624e9bff8356c8dbe2aabc49599e2 --- src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index ae56f2a..e80e2be 100644 --- a/src/main.rs +++ b/src/main.rs @@ -290,10 +290,9 @@ fn render_uniforms(device: &Device, device_memory: &vk::DeviceMemory, .rotate(&Vec3::new(0.0, 1.0, 0.0), time % TAU), translation: Vec3::new(0.0, 0.0, 0.0), }; - let view = Transformation { - rotation: Vec4::rotation_quaternion(&Vec3::new(1.0, 0.0, 0.0), 0.1), - translation: Vec3::new(0.0, 0.0, 2.0), - }; + let view = Transformation::look_at(&Vec3::new(0.0, -1.0, -2.0), + &Vec3::new(0.0, 0.0, 0.0), + &Vec3::new(0.0, -1.0, 0.0)); let aspect_ratio = extent.width as f32 / extent.height as f32; let projection = Mat4::perspective(FRAC_PI_4, aspect_ratio, 0.1, 10.0); let block = UniformBlock:: { scale, model, view, projection }; -- cgit 1.4.1