-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcube-verts.py
More file actions
43 lines (35 loc) · 725 Bytes
/
cube-verts.py
File metadata and controls
43 lines (35 loc) · 725 Bytes
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
def verts(x, y, z, n):
vertices = (
(x, -y, -z),
(x, y, -z),
(-x, y, -z),
(-x, -y, -z),
(x, -y, z),
(x, y, z),
(-x, -y, z),
(-x, y, z)
)
return(vertices)
print(verts(1, 1, 1, 1))
surfaces = (
(0,1,2,3),
(3,2,7,6),
(6,7,5,4),
(4,5,1,0),
(1,5,7,2),
(4,0,3,6)
)
def Cube():
glBegin(GL_QUADS)
for surface in surfaces:
x = 0
for vertex in surface:
x+=1
glColor3fv(colors[x])
glVertex3fv(verts(1, 1, 1, 1)[vertex])
glEnd()
glBegin(GL_LINES)
for edge in edges:
for vertex in edge:
glVertex3fv(verticies[vertex])
glEnd()