diff --git a/src/rendering/twn_draw.c b/src/rendering/twn_draw.c index 8115425..d55189f 100644 --- a/src/rendering/twn_draw.c +++ b/src/rendering/twn_draw.c @@ -491,31 +491,19 @@ DrawCameraFromPrincipalAxesResult draw_camera_from_principal_axes(Vec3 position, sincosf(yaw + (float)M_PI_2, &yaws, &yawc); sincosf(pitch, &pitchs, &pitchc); - Camera const camera = { - .fov = fov, - .pos = position, - .target = vec3_norm(((Vec3){ - yawc * pitchc, - pitchs, - yaws * pitchc, - })), - .up = (Vec3){0, 1, 0}, - .viewbox = { - (Vec2){ 1/-zoom, 1/zoom }, - (Vec2){ 1/zoom, 1/-zoom } - }, - }; + Vec3 const direction = vec3_norm(((Vec3){ + yawc * pitchc, + pitchs, + yaws * pitchc, + })); - if (!orthographic) - camera_projection_matrix = camera_perspective(&camera); - else - camera_projection_matrix = camera_orthographic(&camera); + Vec3 const up = (Vec3){0, 1, 0}; - camera_look_at_matrix = camera_look_at(&camera); + draw_camera(position, direction, up, fov, zoom); return (DrawCameraFromPrincipalAxesResult) { - .direction = camera.target, - .up = camera.up, + .direction = direction, + .up = up, }; }