From 137b122f68b76854af309dd3b7c60d31968108d0 Mon Sep 17 00:00:00 2001 From: 0scar Date: Tue, 13 Feb 2024 09:47:05 +0100 Subject: Add fixed view angle --- src/rendering/src/rendering.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/rendering') diff --git a/src/rendering/src/rendering.c b/src/rendering/src/rendering.c index b74a146..bf57578 100644 --- a/src/rendering/src/rendering.c +++ b/src/rendering/src/rendering.c @@ -86,7 +86,10 @@ void render_present(Window* w) { model[3][2] = pos[2]; /* Lookat zero should be changed to whatever later */ - glm_lookat(c.pos, GLM_VEC3_ZERO, GLM_YUP, v); + vec3 angle = {1, 0.5, 1}; + glm_vec3_sub(c.pos, angle, angle); + glm_lookat(c.pos, angle, GLM_YUP, v); + printf("%1.f %.1f %.1f\r", c.pos[0], c.pos[1], c.pos[2]); { mat4 t; //modelviewprojection = p * v * model @@ -168,7 +171,7 @@ void r_perspective(f32 ratio, f32 fov, Camera *c) { } void r_perspective_ortho(f32 ratio, f32 sz, Camera *c) { - glm_ortho(-sz * ratio, sz * ratio, -sz, sz, -sz, sz, c->per); + glm_ortho(-sz * ratio, sz * ratio, -sz, sz, -sz * 10.f, sz * 10.f, c->per); } void r_set_camera(Camera* c) { -- cgit v1.3