New geometry data structures.
This commit is contained in:
33
src/gen.c
33
src/gen.c
@@ -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}};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user