switch to right-handed CS

This commit is contained in:
numzero 2026-07-25 02:05:55 +03:00
parent 9c05c61a16
commit d6d2a93b24
4 changed files with 5 additions and 5 deletions

View File

@ -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,
)
}

View File

@ -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 {

View File

@ -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()
},

View File

@ -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);