@@ -24,9 +24,12 @@ def __init__(self,
2424 self .width = 500
2525 self .height = 500
2626
27- self .vertices = [(- 1 ,- 1 ,- 1 ), ( 1 ,- 1 ,- 1 ), ( 1 , 1 ,- 1 ), (- 1 , 1 ,- 1 ), (- 1 ,- 1 , 1 ), ( 1 ,- 1 , 1 ), ( 1 , 1 , 1 ), (- 1 , 1 , 1 )]
28- self .faces = [(4 ,0 ,3 ,7 ), (1 ,0 ,4 ,5 ), (0 ,1 ,2 ,3 ), (1 ,5 ,6 ,2 ), (3 ,2 ,6 ,7 ), (5 ,4 ,7 ,6 )]
29- self .colors = [(1 , 0 , 0 ), (0 , 1 , 0 ), (0 , 0 , 1 ), (1 , 1 , 0 ), (1 , 0 , 1 ), (0 , 1 , 1 )]
27+ #self.vertices = [(-2,-2,-2), ( 0,-2,-2), ( 0, 0,-2), (-2, 0,-2), (-2,-2, 0), ( 0,-2, 0), ( 0, 0, 0), (-2, 0, 0)]
28+ self .vertices = my_object .vertices
29+ #self.faces = [(4,0,3,7), (1,0,4,5), (0,1,2,3), (1,5,6,2), (3,2,6,7), (5,4,7,6)]
30+ self .faces = my_object .polygons
31+ #self.colors = [(1, 0, 0), (0, 1, 0), (0, 0, 1), (1, 1, 0), (1, 0, 1), (0, 1, 1)]
32+ self .colors = [my_object .colour ,my_object .colour ,my_object .colour ,my_object .colour ,my_object .colour ,my_object .colour ]
3033
3134 def cube (self ):
3235 ogl .glRotatef (1 , 3 , 1 , 1 )
@@ -64,7 +67,7 @@ def displayWindow(self):
6467
6568 ogl .glMatrixMode (ogl .GL_MODELVIEW )
6669 ogl .glLoadIdentity ()
67- ogl .glTranslatef (0 , 0 , - 10 )
70+ ogl .glTranslatef (0 , 0 , - 100 )
6871
6972 ogl .glEnable (ogl .GL_DEPTH_TEST )
7073
@@ -110,7 +113,7 @@ def displayWindow(self):
110113 oglut .glutInitWindowSize (800 , 500 )
111114 wind = oglut .glutCreateWindow (b'OpenGL' )
112115
113- id_canvas = IDDraw (0 ,a .cont .objectlist [0 ].objectlist [0 ].objectlist [0 ].objectlist [0 ])
116+ id_canvas = IDDraw (0 ,a .cont .objectlist [0 ].objectlist [0 ].objectlist [20 ].objectlist [0 ])
114117
115118 id_canvas .displayWindow ()
116119 pass
0 commit comments