/
vertexdata.go
109 lines (87 loc) · 1.35 KB
/
vertexdata.go
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
package main
import "github.com/PieterD/glimmer/gli"
var vertexExtent = gli.Extent{
Type: gli.GlFloat,
Components: 3,
}
var colorExtent = gli.Extent{
Type: gli.GlFloat,
Components: 4,
Start: 6 * 4 * 3 * 4,
}
var rectObject = gli.Object{
Mode: gli.Triangles,
Vertices: 6 * 2 * 3,
IndexType: gli.GlUShort,
}
var vertexData = []float32{
//Front
+1.0, +1.0, +1.0,
+1.0, -1.0, +1.0,
-1.0, -1.0, +1.0,
-1.0, +1.0, +1.0,
//Top
+1.0, +1.0, +1.0,
-1.0, +1.0, +1.0,
-1.0, +1.0, -1.0,
+1.0, +1.0, -1.0,
//Let
+1.0, +1.0, +1.0,
+1.0, +1.0, -1.0,
+1.0, -1.0, -1.0,
+1.0, -1.0, +1.0,
//Back
+1.0, +1.0, -1.0,
-1.0, +1.0, -1.0,
-1.0, -1.0, -1.0,
+1.0, -1.0, -1.0,
//Bottom
+1.0, -1.0, +1.0,
+1.0, -1.0, -1.0,
-1.0, -1.0, -1.0,
-1.0, -1.0, +1.0,
//Right
-1.0, +1.0, +1.0,
-1.0, -1.0, +1.0,
-1.0, -1.0, -1.0,
-1.0, +1.0, -1.0,
//Colors
0, 1, 0, 1,
0, 1, 0, 1,
0, 1, 0, 1,
0, 1, 0, 1,
0, 0, 1, 1,
0, 0, 1, 1,
0, 0, 1, 1,
0, 0, 1, 1,
1, 0, 0, 1,
1, 0, 0, 1,
1, 0, 0, 1,
1, 0, 0, 1,
1, 1, 0, 1,
1, 1, 0, 1,
1, 1, 0, 1,
1, 1, 0, 1,
0, 1, 1, 1,
0, 1, 1, 1,
0, 1, 1, 1,
0, 1, 1, 1,
1, 0, 1, 1,
1, 0, 1, 1,
1, 0, 1, 1,
1, 0, 1, 1,
}
var indexData = []uint16{
0, 1, 2,
2, 3, 0,
4, 5, 6,
6, 7, 4,
8, 9, 10,
10, 11, 8,
12, 13, 14,
14, 15, 12,
16, 17, 18,
18, 19, 16,
20, 21, 22,
22, 23, 20,
}