-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcube.c
executable file
·80 lines (76 loc) · 1.94 KB
/
cube.c
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
f32 cubeVertices[] ATTRIBUTE_ALIGN(32) = {
-1.00F, -1.00F, 1.00F,
-1.00F, 1.00F, 1.00F,
-1.00F, -1.00F, -1.00F,
-1.00F, 1.00F, -1.00F,
1.00F, -1.00F, 1.00F,
1.00F, 1.00F, 1.00F,
1.00F, -1.00F, -1.00F,
1.00F, 1.00F, -1.00F,
-1.00F, 0.00F, 0.00F,
0.00F, 0.00F, -1.00F,
1.00F, 0.00F, 0.00F,
0.00F, 0.00F, 1.00F,
0.00F, -1.00F, 0.00F,
0.00F, 1.00F, 0.00F
};
u16 cubeIndices[] ATTRIBUTE_ALIGN(32) = {
1, 2, 0,
3, 6, 2,
7, 4, 6,
5, 0, 4,
6, 0, 2,
3, 5, 7,
1, 3, 2,
3, 7, 6,
7, 5, 4,
5, 1, 0,
6, 4, 0,
3, 1, 5
};
f32 cubeTexCoords[] ATTRIBUTE_ALIGN(32) = {
1.00000F, 0.00000F,
0.00000F, 1.00000F,
0.00000F, 0.00000F,
1.00000F, 0.00000F,
0.00000F, 1.00000F,
0.00000F, 0.00000F,
1.00000F, 0.00000F,
0.00000F, 1.00000F,
0.00000F, 0.00000F,
1.00000F, 0.00000F,
0.00000F, 1.00000F,
0.00000F, 0.00000F,
1.00000F, 0.00000F,
0.00000F, 1.00000F,
0.00000F, 0.00000F,
1.00000F, 1.00000F,
1.00000F, 1.00000F,
1.00000F, 1.00000F,
1.00000F, 1.00000F,
1.00000F, 1.00000F,
};
u16 cubeTexIndices[] ATTRIBUTE_ALIGN(32) = {
0, 1, 2,
3, 4, 5,
6, 7, 8,
9, 10, 11,
12, 10, 5,
3, 13, 14,
0, 15, 1,
3, 16, 4,
6, 17, 7,
9, 18, 10,
12, 19, 10,
3, 18, 13
};
struct Model cube = {
.vertices = cubeVertices,
.verticesAmount = 14,
.indices = cubeIndices,
.indicesAmount = 36,
.texCoords = cubeTexCoords,
.texCoordsAmount = 40,
.texIndices = cubeTexIndices,
.texIndicesAmount = 36
};