Inverted view matrix

This commit is contained in:
Lorenzo Torres 2025-08-06 16:08:36 +02:00
parent fb031e8a66
commit c3a85ce50f
2 changed files with 3 additions and 2 deletions

View file

@ -43,7 +43,8 @@ pub const Matrix = struct {
pub fn lookAt(eye: [3]f32, target: [3]f32, arbitrary_up: [3]f32) Matrix {
const t: @Vector(3, f32) = target;
const e: @Vector(3, f32) = eye;
var e: @Vector(3, f32) = eye;
e = -e;
const u: @Vector(3, f32) = arbitrary_up;
const forward = normalize(t - e);
const right = normalize(cross(forward, u));