switch to right-handed CS
This commit is contained in:
parent
9c05c61a16
commit
d6d2a93b24
|
|
@ -31,7 +31,7 @@ impl OrbitalCamera {
|
||||||
// X -> -Z
|
// X -> -Z
|
||||||
// Y -> -X
|
// Y -> -X
|
||||||
// Z -> Y
|
// Z -> Y
|
||||||
Mat4::from_translation(vec3(0., 0., self.distance))
|
Mat4::from_translation(vec3(0., 0., -self.distance))
|
||||||
* Mat4::from_cols_array_2d(&[
|
* Mat4::from_cols_array_2d(&[
|
||||||
[0., 0., -1., 0.],
|
[0., 0., -1., 0.],
|
||||||
[-1., 0., 0., 0.],
|
[-1., 0., 0., 0.],
|
||||||
|
|
@ -40,7 +40,7 @@ impl OrbitalCamera {
|
||||||
]) * Mat4::from_euler(
|
]) * Mat4::from_euler(
|
||||||
glam::EulerRot::ZYZ,
|
glam::EulerRot::ZYZ,
|
||||||
0.,
|
0.,
|
||||||
self.position_pitch,
|
-self.position_pitch,
|
||||||
-self.position_yaw,
|
-self.position_yaw,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ impl Core {
|
||||||
position_pitch: args.light_pitch,
|
position_pitch: args.light_pitch,
|
||||||
distance: 1.,
|
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.pipeline.set_look(
|
||||||
&self.queue,
|
&self.queue,
|
||||||
render::LookParams {
|
render::LookParams {
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ impl Pipeline {
|
||||||
},
|
},
|
||||||
primitive: wgpu::PrimitiveState {
|
primitive: wgpu::PrimitiveState {
|
||||||
topology: wgpu::PrimitiveTopology::TriangleList,
|
topology: wgpu::PrimitiveTopology::TriangleList,
|
||||||
front_face: wgpu::FrontFace::Cw,
|
front_face: wgpu::FrontFace::Ccw,
|
||||||
cull_mode: Some(wgpu::Face::Back),
|
cull_mode: Some(wgpu::Face::Back),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ void Hyperboloid::updateView() {
|
||||||
.background = { color.redF(), color.greenF(), color.blueF(), 1.00 },
|
.background = { color.redF(), color.greenF(), color.blueF(), 1.00 },
|
||||||
.camera_yaw = qDegreesToRadians((float)m_ui->camYaw->value()),
|
.camera_yaw = qDegreesToRadians((float)m_ui->camYaw->value()),
|
||||||
.camera_pitch = qDegreesToRadians((float)m_ui->camPitch->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()),
|
.light_pitch = qDegreesToRadians((float)m_ui->lightPitch->value()),
|
||||||
};
|
};
|
||||||
m_ui->viewport->setView(args);
|
m_ui->viewport->setView(args);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user