diff --git a/src/camera.rs b/src/camera.rs index c55ae91..992f33a 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -31,7 +31,7 @@ impl OrbitalCamera { // X -> -Z // Y -> -X // Z -> Y - Mat4::from_translation(vec3(0., 0., self.distance)) + Mat4::from_translation(vec3(0., 0., -self.distance)) * Mat4::from_cols_array_2d(&[ [0., 0., -1., 0.], [-1., 0., 0., 0.], @@ -40,7 +40,7 @@ impl OrbitalCamera { ]) * Mat4::from_euler( glam::EulerRot::ZYZ, 0., - self.position_pitch, + -self.position_pitch, -self.position_yaw, ) } diff --git a/src/lib.rs b/src/lib.rs index e20fd95..901c0a6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -130,7 +130,7 @@ impl Core { position_pitch: args.light_pitch, distance: 1., }; - let perspective = Mat4::perspective_lh(std::f32::consts::FRAC_PI_3, aspect, 1e1, 1e3); + let perspective = Mat4::perspective_rh(std::f32::consts::FRAC_PI_3, aspect, 1e1, 1e3); self.pipeline.set_look( &self.queue, render::LookParams { diff --git a/src/render.rs b/src/render.rs index f267bd3..c73bdde 100644 --- a/src/render.rs +++ b/src/render.rs @@ -88,7 +88,7 @@ impl Pipeline { }, primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, - front_face: wgpu::FrontFace::Cw, + front_face: wgpu::FrontFace::Ccw, cull_mode: Some(wgpu::Face::Back), ..Default::default() }, diff --git a/ui/src/main_window.cxx b/ui/src/main_window.cxx index b951acc..dc9ba4c 100644 --- a/ui/src/main_window.cxx +++ b/ui/src/main_window.cxx @@ -57,7 +57,7 @@ void Hyperboloid::updateView() { .background = { color.redF(), color.greenF(), color.blueF(), 1.00 }, .camera_yaw = qDegreesToRadians((float)m_ui->camYaw->value()), .camera_pitch = qDegreesToRadians((float)m_ui->camPitch->value()), - .light_yaw = 0.0, + .light_yaw = qDegreesToRadians(-135.0f), .light_pitch = qDegreesToRadians((float)m_ui->lightPitch->value()), }; m_ui->viewport->setView(args);