-
Notifications
You must be signed in to change notification settings - Fork 15
/
mesh_cube.h
36 lines (31 loc) · 951 Bytes
/
mesh_cube.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef MESH_H
#define MESH_H
#define NODECOUNT 8
#define TRICOUNT 12
#define NODE(a, b) (long)(pgm_read_dword(&nodes[a][b]))
#define EDGE(a, b) pgm_read_byte(&faces[a][b])
const long nodes[NODECOUNT][3] PROGMEM = {
{(long)(14.0*PRES), (long)(14.0*PRES), (long)(-14.0*PRES)},
{(long)(14.0*PRES), (long)(-14.0*PRES), (long)(-14.0*PRES)},
{(long)(-14.0*PRES), (long)(-14.0*PRES), (long)(-14.0*PRES)},
{(long)(-14.0*PRES), (long)(14.0*PRES), (long)(-14.0*PRES)},
{(long)(14.0*PRES), (long)(14.0*PRES), (long)(14.0*PRES)},
{(long)(-14.0*PRES), (long)(14.0*PRES), (long)(14.0*PRES)},
{(long)(-14.0*PRES), (long)(-14.0*PRES), (long)(14.0*PRES)},
{(long)(14.0*PRES), (long)(-14.0*PRES), (long)(14.0*PRES)},
};
const unsigned char faces[TRICOUNT][3] PROGMEM = {
{0, 1, 2},
{2, 3, 0},
{4, 5, 6},
{6, 7, 4},
{0, 4, 7},
{7, 1, 0},
{1, 7, 6},
{6, 2, 1},
{2, 6, 5},
{5, 3, 2},
{4, 0, 3},
{3, 5, 4},
};
#endif // MESH_H