diff options
| author | Irene Knapp <ireneista@irenes.space> | 2026-07-17 14:25:30 -0700 |
|---|---|---|
| committer | Irene Knapp <ireneista@irenes.space> | 2026-07-17 14:25:30 -0700 |
| commit | f7e6dec079dcbbc26a9e047cf2b0acf23c091836 (patch) | |
| tree | a5d340b39cf54bbb9ee57496a81e284205ed3ac4 /src/main.rs | |
| parent | dcbafa3d15f941dc46639a418e5724394d9a8ba2 (diff) | |
add Transformation::look_at()
now we have real camera behavior. yay! Force-Push: yes Change-Id: I291d0cce0f2624e9bff8356c8dbe2aabc49599e2
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 7 |
1 files changed, 3 insertions, 4 deletions
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::<f32> { scale, model, view, projection }; |