diff options
| author | Connor Thomson <blumatrikz@gmail.com> | 2026-09-11 08:12:59 -0700 |
|---|---|---|
| committer | Connor Thomson <blumatrikz@gmail.com> | 2026-09-11 08:12:59 -0700 |
| commit | 307151fb8615a9d0ae80f3827d9c028313a40912 (patch) | |
| tree | fa03f6262eac90d36b9fbf584b5c10ac692afaea /src/model.c | |
| parent | 6d5e4308a2ab0ceee2b9311afc92ba449ff81a45 (diff) | |
Add fov control and change fov
Diffstat (limited to 'src/model.c')
| -rw-r--r-- | src/model.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |