fix aspect ratio as well as billboard scaling

This commit is contained in:
veclavtalica
2025-01-05 21:08:54 +03:00
parent cb6c1df0be
commit d7a119a592
3 changed files with 10 additions and 10 deletions

View File

@ -39,7 +39,7 @@ Matrix4 camera_perspective(const Camera *const camera) {
/* from cglm */
Matrix4 result = {0};
const float aspect = (float)(ctx.base_render_width / ctx.base_render_height);
const float aspect = ((float)ctx.base_render_width / (float)ctx.base_render_height);
const float f = 1.0f / tanf(camera->fov * 0.5f);
const float fn = 1.0f / (CAMERA_NEAR_Z - CAMERA_FAR_Z);