Create material abstraction

This commit is contained in:
2025-09-23 15:36:08 +01:00
parent b15edd1906
commit ce45c57662
8 changed files with 84 additions and 26 deletions

View File

@@ -40,6 +40,15 @@ vec3_t vec3_cross(vec3_t v, vec3_t u)
};
}
vec3_t vec3_hadamard(vec3_t v, vec3_t u)
{
return (vec3_t) {
.x = v.x * u.x,
.y = v.y * u.y,
.z = v.z * u.z,
};
}
double vec3_len(vec3_t v)
{
return sqrt(v.x * v.x + v.y * v.y + v.z * v.z);