normalize camera direction

This commit is contained in:
veclavtalica 2025-01-27 03:46:29 +03:00
parent 6a87119c70
commit d84e5f8610

View File

@ -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,