Пример #1
0
 def update_perspective(self, gl):
     
     if self.DEBUG_MODE != None:
         self.render_state.radius_of_view = Debug.RADIUSOFVIEW
     
     self.projection_matrix = Matrix4x4.create_perspective_projection(
             self.get_width(),
             self.get_height(),
             self.render_state.radius_of_view * 3.141593 / 360.0)
     
     gl.glMatrixMode(gl.GL_PROJECTION)
         
     matrix = np.array(self.projection_matrix.values, dtype=np.float32)
     gl.glLoadMatrixf(matrix)
     
     # The image is mirrored so scale it to make the polygon fronts into backs 
     gl.glScalef(-1.0, 1.0, 1.0)
     
     # Switch back to the model view matrix.
     gl.glMatrixMode(gl.GL_MODELVIEW)