This commit is contained in:
Hiroaki Yutani 2021-04-11 17:09:10 +09:00
parent ecf8076b75
commit 1bb374c89e
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ struct Camera {
impl Camera {
fn build_view_projection_matrix(&self) -> cgmath::Matrix4<f32> {
// 1.
let view = cgmath::Matrix4::look_at(self.eye, self.target, self.up);
let view = cgmath::Matrix4::look_at_rh(self.eye, self.target, self.up);
// 2.
let proj = cgmath::perspective(cgmath::Deg(self.fovy), self.aspect, self.znear, self.zfar);

View File

@ -50,7 +50,7 @@ impl Camera {
}
pub fn calc_matrix(&self) -> Matrix4<f32> {
Matrix4::look_at_dir(
Matrix4::look_to_rh(
self.position,
Vector3::new(
self.yaw.0.cos(),