New geometry data structures.

This commit is contained in:
2025-12-13 11:13:20 -05:00
parent 4d372ff3d1
commit 903820d635
3 changed files with 29 additions and 56 deletions

View File

@@ -1,5 +1,4 @@
#include "include/gen.h"
#include "include/col.h"
#include <stdlib.h>
#include <time.h>
@@ -107,25 +106,17 @@ Pt world_edge_idx_to_pt(int idx) {
void gen_lith() {
srand(time(NULL));
Pt p1 = {(rand() % 6) + 1, 0};
Pt p2 = {(rand() % 6) + 1, 7};
lith[0] = (Plate){
.col = COL_RED,
.nverts = 4,
.verts = {
(Pt){0, 0},
p1,
p2,
(Pt){0, 7},
},
Tri tri1 = {
(Pt){0, 0},
(Pt){0, 7},
(Pt){7, 0},
};
lith[1] = (Plate){.col = COL_RED,
.nverts = 4,
.verts = {
p1,
(Pt){7, 0},
(Pt){7, 7},
p2,
}};
Tri tri2 = {
(Pt){7, 0},
(Pt){0, 7},
(Pt){7, 7},
};
lith[0] = (Plate){.tris = {tri1}};
lith[1] = (Plate){.tris = {tri2}};
}