예제 #1
0
파일: widget.py 프로젝트: SCIInstitute/MLM
 def resizeGL(self, width, height):
     """
     Called upon window resizing: reinitialize the viewport.
     """
     # update the window size
     self.width, self.height = width, height
     self.x_ticks = int(self.width / 80)
     self.y_ticks = int(self.height / 14)
     if self.y_ticks > 6:
         self.y_ticks = int(self.y_ticks / 1.5)
     self.setOrtho(self.view.view())
     #print "Resizing"
     QGLWidget.resizeGL(self, width, height)
예제 #2
0
    def resizeGL(self, width, height):
        QGLWidget.resizeGL(self, width, height)

        glViewport(0, 0, width, height)

        glMatrixMode(GL_PROJECTION)
        glLoadIdentity()

        cfg = Config('game', 'OpenGL')
        fovy = cfg.get('y_field_of_view')
        z_near = cfg.get('z_near')
        z_far = cfg.get('z_far')
        gluPerspective(fovy, float(width) / height, z_near, z_far)
예제 #3
0
 def resizeGL(self, width, height):
     QGLWidget.resizeGL(self,width,height)
     
     glViewport(0,0,width,height)
     
     glMatrixMode(GL_PROJECTION)
     glLoadIdentity()
     
     cfg = Config('game','OpenGL')
     fovy = cfg.get('y_field_of_view')
     z_near = cfg.get('z_near')
     z_far = cfg.get('z_far')
     gluPerspective(fovy,float(width)/height,z_near,z_far)
예제 #4
0
 def resizeGL(self, width, height):
     QGLWidget.resizeGL(self,width,height)
     default_perspective(width, height)
     
     self.mouse_center = (width / 2, height / 2)