summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0scar <qgt268@alumni.ku.dk>2024-02-13 08:47:05 +0000
committer0scar <qgt268@alumni.ku.dk>2024-02-13 09:12:04 +0000
commit137b122f68b76854af309dd3b7c60d31968108d0 (patch)
tree3e58a78188ca7110fe92b5d991cadce430c32147
parente1d03dafe460e00a27975519e4d911274f13eeb5 (diff)
Add fixed view angle
-rw-r--r--src/rendering/src/rendering.c7
1 files changed, 5 insertions, 2 deletions
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) {