From 0ace7a7dfa6217c502db4ee40111eec543f0b39d Mon Sep 17 00:00:00 2001 From: _ <_@_> Date: Sun, 19 Dec 2021 19:50:55 +0000 Subject: [PATCH] move the camera and stuff to try to match the Blender scene --- src/bin/platformer/graphics.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/bin/platformer/graphics.rs b/src/bin/platformer/graphics.rs index 1938dcc..735ebe1 100644 --- a/src/bin/platformer/graphics.rs +++ b/src/bin/platformer/graphics.rs @@ -174,14 +174,13 @@ impl Graphics { let screen_size = (320.0, 240.0); - let fov = 30.0f32; + let fov = 40.0f32; let proj_mat = Mat4::perspective_rh_gl (fov.to_radians (), screen_size.0 / screen_size.1, 0.125, 200.0); let view_mat = proj_mat * - Mat4::from_translation ((0.0, 0.0, -20.0).into ()) * - Mat4::from_rotation_x ((45.0 - 90.0f32).to_radians ()) - ; + Mat4::from_rotation_x (-63.6f32.to_radians ()) * + Mat4::from_translation ((0.0, 23.3, -12.2).into ()); let world_model_mat = Mat4::IDENTITY; self.passes [0].with (gl_state, || { @@ -193,7 +192,7 @@ impl Graphics { let attrs = shader_vars.attrs; let unis = shader_vars.unis; - if false { + if true { self.texture_earth.bind (); let mvp = view_mat * @@ -281,7 +280,7 @@ impl Graphics { ); gl::DrawElements ( gl::TRIANGLES, - 3 * 12, + indices.count ().try_into ().unwrap (), gl::UNSIGNED_SHORT, &level.buffer [indices.offset () + indices_view.offset ()] as *const u8 as *const c_void, ); @@ -339,7 +338,7 @@ impl Graphics { } } - if false { + if true { let sky_mvp_mat = view_mat * Mat4::from_scale ((64.0, 64.0, 64.0).into ()); self.texture_sky.bind ();