From 307151fb8615a9d0ae80f3827d9c028313a40912 Mon Sep 17 00:00:00 2001 From: Connor Thomson Date: Fri, 11 Sep 2026 08:12:59 -0700 Subject: Add fov control and change fov --- src/model.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/model.c') diff --git a/src/model.c b/src/model.c index 15b3c97..7902f7a 100644 --- a/src/model.c +++ b/src/model.c @@ -22,6 +22,7 @@ #include "model.h" #include "camera.h" #include "files.h" +#include "ta_math.h" static bool ta_model_push_vertex(ta_model_mesh *mesh, size_t *capacity, const ta_model_vertex *vertex) { if (mesh->vertex_count == *capacity) { @@ -329,7 +330,7 @@ void ta_model_render(const ta_model *model, SDL_GPUCommandBuffer *command_buffer uniforms.model[13] = model->position[1]; uniforms.model[14] = model->position[2]; float aspect = (float)window_width / (float)window_height; - float focal_length = 1.0f / tanf(22.5f * 0.01745329252f); + float focal_length = 1.0f / tanf(ta_rad(ta_camera_current.fov * 0.5f)); float near_plane = 0.1f; float far_plane = 100.0f; ta_camera_get_view_matrix(view); -- cgit v1.2.3