forked from mrt-prodz/ATmega328-Tiny-3D-Engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mesh_torus.h
124 lines (119 loc) · 3.65 KB
/
mesh_torus.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#ifndef MESH_H
#define MESH_H
#define NODECOUNT 36
#define TRICOUNT 72
#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)(32.16*PRES), (long)(0.0*PRES), (long)(0.0*PRES)},
{(long)(16.08*PRES), (long)(27.8514*PRES), (long)(0.0*PRES)},
{(long)(14.04*PRES), (long)(24.318*PRES), (long)(7.0668*PRES)},
{(long)(28.08*PRES), (long)(0.0*PRES), (long)(7.0668*PRES)},
{(long)(9.96*PRES), (long)(17.2512*PRES), (long)(7.0668*PRES)},
{(long)(19.92*PRES), (long)(0.0*PRES), (long)(7.0668*PRES)},
{(long)(7.92*PRES), (long)(13.7178*PRES), (long)(0.0*PRES)},
{(long)(15.84*PRES), (long)(0.0*PRES), (long)(0.0*PRES)},
{(long)(9.96*PRES), (long)(17.2512*PRES), (long)(-7.0668*PRES)},
{(long)(19.92*PRES), (long)(0.0*PRES), (long)(-7.0668*PRES)},
{(long)(14.04*PRES), (long)(24.318*PRES), (long)(-7.0668*PRES)},
{(long)(28.08*PRES), (long)(0.0*PRES), (long)(-7.0668*PRES)},
{(long)(-16.08*PRES), (long)(27.8514*PRES), (long)(0.0*PRES)},
{(long)(-14.04*PRES), (long)(24.318*PRES), (long)(7.0668*PRES)},
{(long)(-9.96*PRES), (long)(17.2512*PRES), (long)(7.0668*PRES)},
{(long)(-7.92*PRES), (long)(13.7178*PRES), (long)(0.0*PRES)},
{(long)(-9.96*PRES), (long)(17.2512*PRES), (long)(-7.0668*PRES)},
{(long)(-14.04*PRES), (long)(24.318*PRES), (long)(-7.0668*PRES)},
{(long)(-32.16*PRES), (long)(0.0*PRES), (long)(0.0*PRES)},
{(long)(-28.08*PRES), (long)(0.0*PRES), (long)(7.0668*PRES)},
{(long)(-19.92*PRES), (long)(0.0*PRES), (long)(7.0668*PRES)},
{(long)(-15.84*PRES), (long)(0.0*PRES), (long)(0.0*PRES)},
{(long)(-19.92*PRES), (long)(0.0*PRES), (long)(-7.0668*PRES)},
{(long)(-28.08*PRES), (long)(0.0*PRES), (long)(-7.0668*PRES)},
{(long)(-16.08*PRES), (long)(-27.8514*PRES), (long)(0.0*PRES)},
{(long)(-14.04*PRES), (long)(-24.318*PRES), (long)(7.0668*PRES)},
{(long)(-9.96*PRES), (long)(-17.2512*PRES), (long)(7.0668*PRES)},
{(long)(-7.92*PRES), (long)(-13.7178*PRES), (long)(0.0*PRES)},
{(long)(-9.96*PRES), (long)(-17.2512*PRES), (long)(-7.0668*PRES)},
{(long)(-14.04*PRES), (long)(-24.318*PRES), (long)(-7.0668*PRES)},
{(long)(16.08*PRES), (long)(-27.8514*PRES), (long)(0.0*PRES)},
{(long)(14.04*PRES), (long)(-24.318*PRES), (long)(7.0668*PRES)},
{(long)(9.96*PRES), (long)(-17.2512*PRES), (long)(7.0668*PRES)},
{(long)(7.92*PRES), (long)(-13.7178*PRES), (long)(0.0*PRES)},
{(long)(9.96*PRES), (long)(-17.2512*PRES), (long)(-7.0668*PRES)},
{(long)(14.04*PRES), (long)(-24.318*PRES), (long)(-7.0668*PRES)},
};
const unsigned char faces[TRICOUNT][3] PROGMEM = {
{0, 1, 2},
{2, 3, 0},
{3, 2, 4},
{4, 5, 3},
{5, 4, 6},
{6, 7, 5},
{7, 6, 8},
{8, 9, 7},
{9, 8, 10},
{10, 11, 9},
{0, 11, 10},
{10, 1, 0},
{1, 12, 13},
{13, 2, 1},
{2, 13, 14},
{14, 4, 2},
{4, 14, 15},
{15, 6, 4},
{6, 15, 16},
{16, 8, 6},
{8, 16, 17},
{17, 10, 8},
{10, 17, 12},
{12, 1, 10},
{12, 18, 19},
{19, 13, 12},
{13, 19, 20},
{20, 14, 13},
{14, 20, 21},
{21, 15, 14},
{15, 21, 22},
{22, 16, 15},
{16, 22, 23},
{23, 17, 16},
{17, 23, 18},
{18, 12, 17},
{18, 24, 25},
{25, 19, 18},
{19, 25, 26},
{26, 20, 19},
{20, 26, 27},
{27, 21, 20},
{21, 27, 28},
{28, 22, 21},
{22, 28, 29},
{29, 23, 22},
{23, 29, 24},
{24, 18, 23},
{24, 30, 31},
{31, 25, 24},
{25, 31, 32},
{32, 26, 25},
{26, 32, 33},
{33, 27, 26},
{27, 33, 34},
{34, 28, 27},
{28, 34, 35},
{35, 29, 28},
{29, 35, 30},
{30, 24, 29},
{30, 0, 3},
{3, 31, 30},
{31, 3, 5},
{5, 32, 31},
{32, 5, 7},
{7, 33, 32},
{33, 7, 9},
{9, 34, 33},
{34, 9, 11},
{11, 35, 34},
{0, 30, 35},
{35, 11, 0},
};
#endif // MESH_H