Implement simple line drawing

This commit is contained in:
Camden Dixie O'Brien
2025-10-13 16:22:10 +01:00
parent 87a305c2e5
commit 7097b7fb57
6 changed files with 98 additions and 16 deletions

15
maths.c Normal file
View File

@@ -0,0 +1,15 @@
#include "maths.h"
vec3_t vec2_extend(vec2_t v)
{
return (vec3_t) { v.x, v.y, 1 };
}
vec3_t mat3_mul_vec3(mat3_t m, vec3_t v)
{
return (vec3_t) {
.x = m.x.x * v.x + m.y.x * v.y + m.z.x * v.z,
.y = m.x.y * v.x + m.y.y * v.y + m.z.y * v.z,
.z = m.x.z * v.x + m.y.z * v.y + m.z.z * v.z,
};
}