From 26b4b82a7be2c029491f3009b66b3cbf8db5d93c Mon Sep 17 00:00:00 2001 From: vimene Date: Thu, 2 Jan 2025 13:25:14 +0100 Subject: various improvements - cleaned up the computation of the camera's matrix - changed VertexData to being a struct which transmit data between the "vertex shader" and the "fragment shader" - started working on keyboard and mouse controls - added fov (field of view) - changed quaternion to euler angles conversion, from zyx to zxy - fixed computations of z coordinates in triangle rendering - improved naming in the triangle rasterizer --- src/math/vector.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/math/vector.h') diff --git a/src/math/vector.h b/src/math/vector.h index b26c5fe..d755c89 100644 --- a/src/math/vector.h +++ b/src/math/vector.h @@ -101,6 +101,13 @@ struct Vector3 { return *this + (-other); } + constexpr Vector3 operator+=(const Vector3& other) & { + x += other.x; + y += other.y; + z += other.z; + return *this; + } + constexpr Vector3 round() { return { std::round(x), std::round(y), std::round(z) }; } -- cgit v1.2.3