From d84e5f861000959ab329c75f479afa488684185a Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Mon, 27 Jan 2025 03:46:29 +0300 Subject: [PATCH] normalize camera direction --- src/rendering/twn_draw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rendering/twn_draw.c b/src/rendering/twn_draw.c index b8455dc..517fef0 100644 --- a/src/rendering/twn_draw.c +++ b/src/rendering/twn_draw.c @@ -421,7 +421,7 @@ void draw_camera(Vec3 position, Vec3 direction, Vec3 up, float fov, float zoom) Camera const camera = { .fov = fov, .pos = position, - .target = direction, + .target = vec3_norm(direction), .up = up, .viewbox = { (Vec2){ 1/-zoom, 1/zoom }, @@ -459,7 +459,7 @@ DrawCameraFromPrincipalAxesResult draw_camera_from_principal_axes(Vec3 position, Camera const camera = { .fov = fov, .pos = position, - .target = m_vec_norm(((Vec3){ + .target = vec3_norm(((Vec3){ yawc * pitchc, pitchs, yaws * pitchc,