From 323028d1430f11ebdc812ae3c0b0a30f3310f371 Mon Sep 17 00:00:00 2001 From: FreddyFunk <27208977+FreddyFunk@users.noreply.github.com> Date: Wed, 17 Jan 2024 20:11:20 +0100 Subject: [PATCH] implement wonky fix --- src/apps/ray_marching_renderer.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/apps/ray_marching_renderer.rs b/src/apps/ray_marching_renderer.rs index 505487c..f6ffd54 100644 --- a/src/apps/ray_marching_renderer.rs +++ b/src/apps/ray_marching_renderer.rs @@ -698,13 +698,14 @@ impl RayMarchingRenderer { let threshold: f32 = self.threshold; let sample_step_length = self.sample_step_length; - let ray_origin = (self.view_matrix.inverse() * glam::vec4(0.0, 0.0, 2.0, 0.0)).truncate(); + let camera_position = glam::Vec3::new(0.0, 0.0, 2.0); + + // TODO: understand why camera_position + cube/with is required for z + let ray_origin = (self.view_matrix.inverse() * glam::vec4(0.0, 0.0, 3.0, 0.0)).truncate(); let top_aabb = self.extent; let bottom_aabb = -self.extent; - let camera_position = glam::Vec3::new(0.0, 0.0, 2.0); - // The callback function for WGPU is in two stages: prepare, and paint. // // The prepare callback is called every frame before paint and is given access to the wgpu