コード例 #1
0
ファイル: window.py プロジェクト: shdwdln/fos
 def ortho_zoom(self, zoom_level = 1.0):
     if not self.ortho:
         print('Not on orthogonal projection mode')
         return
     vsml.loadIdentity(vsml.MatrixTypes.PROJECTION)
     ratio =  abs(self.width * 1.0 / self.height)
     self.width_ortho = self.width * zoom_level * ratio
     self.height_ortho = self.width * zoom_level
     vsml.ortho(-(self.width_ortho)/2.,(self.width_ortho)/2.,
         (self.height_ortho)/2.,(self.height_ortho)/-2.,-500,8000)
     glMatrixMode(GL_PROJECTION)
     glLoadMatrixf(vsml.get_projection())
     glMatrixMode(GL_MODELVIEW)
コード例 #2
0
ファイル: window.py プロジェクト: shdwdln/fos
 def update_projection(self, factor = 1.0):
     vsml.loadIdentity(vsml.MatrixTypes.PROJECTION)
     ratio =  abs(self.width * 1.0 / self.height)
     if self.ortho:
         self.width_ortho += -factor * ratio
         self.height_ortho += -factor
         vsml.ortho(-(self.width_ortho)/2.,(self.width_ortho)/2.,
             (self.height_ortho)/2.,(self.height_ortho)/-2.,-500,8000)
     else:
         vsml.perspective(60., ratio, .1, 8000)
     glMatrixMode(GL_PROJECTION)
     glLoadMatrixf(vsml.get_projection())
     glMatrixMode(GL_MODELVIEW)