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
|
from OpenGL.GL import *
class WireBox:
def __init__(self, size):
self.x0 = 0
self.x1 = size
self.y0 = 0
self.y1 = size
self.z0 = 0
self.z1 = size
def setup(self):
pass
def update(self):
pass
def shutdown(self):
pass
def display_decoration(self, uniform):
glUniform3fv(uniform['color'], 1, [0.6,0.6,0.6])
glBegin(GL_LINE_STRIP)
glVertex(self.x0, self.y0, self.z0)
glVertex(self.x0, self.y1, self.z0)
glVertex(self.x0, self.y1, self.z1)
glVertex(self.x0, self.y0, self.z1)
glVertex(self.x0, self.y0, self.z0)
glEnd()
glBegin(GL_LINE_STRIP)
glVertex(self.x1, self.y0, self.z0)
glVertex(self.x1, self.y1, self.z0)
glVertex(self.x1, self.y1, self.z1)
glVertex(self.x1, self.y0, self.z1)
glVertex(self.x1, self.y0, self.z0)
glEnd()
glBegin(GL_LINE_STRIP)
glVertex(self.x0, self.y0, self.z1)
glVertex(self.x1, self.y0, self.z1)
glVertex(self.x1, self.y1, self.z1)
glVertex(self.x0, self.y1, self.z1)
glVertex(self.x0, self.y0, self.z1)
glEnd()
glBegin(GL_LINE_STRIP)
glVertex(self.x0, self.y0, self.z0)
glVertex(self.x1, self.y0, self.z0)
glVertex(self.x1, self.y1, self.z0)
glVertex(self.x0, self.y1, self.z0)
glVertex(self.x0, self.y0, self.z0)
glEnd()
glBegin(GL_LINE_STRIP)
glVertex(self.x0, self.y0, self.z0)
glVertex(self.x1, self.y0, self.z0)
glVertex(self.x1, self.y0, self.z1)
glVertex(self.x0, self.y0, self.z1)
glVertex(self.x0, self.y0, self.z0)
glEnd()
glBegin(GL_LINE_STRIP)
glVertex(self.x0,self.y1,self.z0)
glVertex(self.x1,self.y1,self.z0)
glVertex(self.x1,self.y1,self.z1)
glVertex(self.x0,self.y1,self.z1)
glVertex(self.x0,self.y1,self.z0)
glEnd()
def display_window(self, uniform):
pass
|