From b2c9782ab2f4abec8f8548e667a8f2ad6e36bd4b Mon Sep 17 00:00:00 2001 From: Omniscient Date: Tue, 18 Jun 2024 11:03:52 +1000 Subject: wip --- src/maths/primitives.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/maths') 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; } -- cgit v1.2.3-70-g09d2