-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModelManager.py
More file actions
26 lines (21 loc) · 787 Bytes
/
ModelManager.py
File metadata and controls
26 lines (21 loc) · 787 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
from settings import *
class Cube():
def __init__(self, vertices, edges, surfaces, colors):
self.vertices = vertices #points in 3D space
self.edges = edges #A line connecting 2 vertices together
self.surfaces = surfaces #A Collection of 4 vertices connected by a plane
self.colors = colors #colors
def create(self):
glBegin(GL_QUADS)
for surface in self.surfaces:
x = 0
for vertex in surface:
x += 1
glColor3fv(self.colors[x])
glVertex3fv(self.vertices[vertex])
glEnd()
glBegin(GL_LINES)
for edge in self.edges:
for vertex in edge:
glVertex3fv(self.vertices[vertex])
glEnd()