summaryrefslogtreecommitdiff
path: root/src/maths/primitives.c
diff options
context:
space:
mode:
authorOmniscient <omniscient.oce@gmail.com>2024-06-18 11:03:52 +1000
committerOmniscient <omniscient.oce@gmail.com>2024-06-18 11:03:52 +1000
commitb2c9782ab2f4abec8f8548e667a8f2ad6e36bd4b (patch)
tree34973f37f585439357a5e455225d272e9398a742 /src/maths/primitives.c
parent4b5695ce26a8f821dfac987e8e11a6ba5eeff610 (diff)
wip
Diffstat (limited to 'src/maths/primitives.c')
-rw-r--r--src/maths/primitives.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/maths/primitives.c b/src/maths/primitives.c
index 2fbe71a..57e85a2 100644
--- a/src/maths/primitives.c
+++ b/src/maths/primitives.c
@@ -29,10 +29,10 @@ void geo_free_data(geometry_data* geo) {
// vertices
vec3 plane_vertex_positions[] = {
- (vec3){ -0.5, 0, -0.5},
- (vec3){ 0.5, 0, -0.5},
- (vec3){ -0.5, 0, 0.5},
- (vec3){ 0.5, 0, 0.5},
+ (vec3){ -0.5, 0, -0.5 },
+ (vec3){ 0.5, 0, -0.5 },
+ (vec3){ -0.5, 0, 0.5 },
+ (vec3){ 0.5, 0, 0.5 },
};
geometry_data geo_create_plane(f32x2 extents) {
@@ -49,17 +49,15 @@ geometry_data geo_create_plane(f32x2 extents) {
VERT_3D(vertices, vert_pos[1], VEC3_Y, vec2(1, 0));
VERT_3D(vertices, vert_pos[2], VEC3_Y, vec2(0, 1));
VERT_3D(vertices, vert_pos[3], VEC3_Y, vec2(1, 1));
-
- push_triangle(indices, 2,1,0);
- push_triangle(indices, 1,2,3);
- geometry_data geo = {
- .format = VERTEX_STATIC_3D,
- .vertices = vertices,
- .has_indices = true,
- .indices = indices,
- .colour = (rgba){ 0, 0, 0, 1 }
- };
+ push_triangle(indices, 2, 1, 0);
+ push_triangle(indices, 1, 2, 3);
+
+ geometry_data geo = { .format = VERTEX_STATIC_3D,
+ .vertices = vertices,
+ .has_indices = true,
+ .indices = indices,
+ .colour = (rgba){ 0, 0, 0, 1 } };
return geo;
}