Skip to content

Commit

Permalink
use a left handed coordinate system
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddyFunk committed Nov 19, 2023
1 parent 1d6fccc commit d7f2131
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/apps/ray_marching_renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,10 @@ impl RayMarchingRenderer {
}
}

let eye = vec3(0.0, 0.0, 2.0);
let center = vec3(0.0, 0.0, -1.0);
let eye = vec3(0.0, 0.0, -2.0);
let center = vec3(0.0, 0.0, 0.0);
let up = vec3(0.0, 1.0, 0.0);
let view_matrix = glam::Mat4::look_at_rh(eye, center, up);
let view_matrix = glam::Mat4::look_at_lh(eye, center, up);

Some(Self {
id,
Expand Down Expand Up @@ -681,11 +681,11 @@ impl RayMarchingRenderer {
y: rect.left_top().y,
};

let z_near = 0.0001;
let z_near = 0.1;
let z_far = 10.0;
let fov_y_radians = 90.0;
let projection_matrix =
glam::Mat4::perspective_rh_gl(fov_y_radians, aspect_ratio, z_near, z_far);
glam::Mat4::perspective_lh(fov_y_radians, aspect_ratio, z_far, z_near);

let projection_view_model_matrix = projection_matrix
* self.view_matrix
Expand Down

0 comments on commit d7f2131

Please sign in to comment.