From: John Tsiombikas Date: Mon, 7 Nov 2022 23:49:06 +0000 (+0200) Subject: adjust fov on aspect change X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;ds=sidebyside;p=voxscape adjust fov on aspect change --- diff --git a/src/main.c b/src/main.c index bbe64fd..bebba84 100644 --- a/src/main.c +++ b/src/main.c @@ -82,7 +82,6 @@ int init(void) return -1; } vox_framebuf(vox, FB_W, FB_H, fb); - vox_proj(vox, 140, 45, 1, 300); vox_fog(vox, 260, COLOR_HORIZON); vox_filter(vox, hfilt, cfilt); @@ -156,6 +155,10 @@ void idle(void) void reshape(int x, int y) { + float aspect = (float)x / y; + + vox_proj(vox, 140, 40 * aspect, 1, 300); + glViewport(0, 0, x, y); win_width = x;