/apps/tools/twndel: camera translation

This commit is contained in:
veclavtalica
2025-03-09 07:38:32 +03:00
parent cd3033f9c4
commit adae6be7e5
3 changed files with 90 additions and 37 deletions

View File

@ -531,8 +531,8 @@ DrawCameraUnprojectResult draw_camera_unproject(Vec2 point,
/* simpler case, just shoot a point from viewbox face along the supplied direction */
if (orthographic) {
Vec3 right = vec3_cross(direction, up);
Vec3 aup = vec3_cross(direction, right);
Vec3 right = vec3_norm(vec3_cross(direction, up));
Vec3 aup = vec3_norm(vec3_cross(direction, right));
return (DrawCameraUnprojectResult){
.direction = direction,
.position = vec3_add(vec3_add(position, vec3_scale(right, v.x * aspect/zoom)), vec3_scale(aup, -v.y * aspect/zoom)),