summaryrefslogtreecommitdiff
path: root/src/maths/primitives.c
diff options
context:
space:
mode:
authoromnisci3nce <omniscient.oce@gmail.com>2024-07-18 23:10:11 +1000
committeromnisci3nce <omniscient.oce@gmail.com>2024-07-18 23:10:11 +1000
commit01d598220b403f4ac4da3b7aa1f0ce398be3198f (patch)
tree1408b120506f29d3a2d6b3b29a0c91fc1b1371eb /src/maths/primitives.c
parent544aac70015b6b075b172c42dd2d90dee3d029c0 (diff)
skybox works
Diffstat (limited to 'src/maths/primitives.c')
-rw-r--r--src/maths/primitives.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/maths/primitives.c b/src/maths/primitives.c
index 04977a6..233a7e0 100644
--- a/src/maths/primitives.c
+++ b/src/maths/primitives.c
@@ -117,6 +117,9 @@ Geometry Geo_CreateCuboid(f32x3 extents) {
for (u32 i = 0; i < vertices->len; i++) {
u32_darray_push(indices, i);
+ vertices->data[i].static_3d.position =
+ vec3_sub(vertices->data[i].static_3d.position,
+ vec3(0.5, 0.5, 0.5)); // make center of the cube is the origin of mesh space
}
Geometry geo = {