diff options
author | Zack Drach <hogbait@gmail.com> | 2013-04-28 02:21:52 -0400 |
---|---|---|
committer | Zack Drach <hogbait@gmail.com> | 2013-04-28 02:21:52 -0400 |
commit | cdfb3c95b3f60026f3c600b6c6766f2fae2773de (patch) | |
tree | a11738ee0f0894546567c62abdb812fe84d314ac | |
parent | 6587efbcbcdb9241ab8a5f06153d32294ec4f6b5 (diff) |
Fix orientation bug in opengl/hellogl example
-rwxr-xr-x | examples/opengl/hellogl.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/examples/opengl/hellogl.py b/examples/opengl/hellogl.py index 976727e..3bb7d49 100755 --- a/examples/opengl/hellogl.py +++ b/examples/opengl/hellogl.py @@ -37,9 +37,9 @@ class Window(QtGui.QWidget): mainLayout.addWidget(self.zSlider) self.setLayout(mainLayout) - self.xSlider.setValue(15 * 16) - self.ySlider.setValue(345 * 16) - self.zSlider.setValue(0 * 16) + self.xSlider.setValue(170 * 16) + self.ySlider.setValue(160 * 16) + self.zSlider.setValue(90 * 16) self.setWindowTitle(self.tr("Hello GL")) @@ -130,7 +130,7 @@ class GLWidget(QtOpenGL.QGLWidget): GL.glMatrixMode(GL.GL_PROJECTION) GL.glLoadIdentity() - GL.glOrtho(-0.5, +0.5, +0.5, -0.5, 4.0, 15.0) + GL.glOrtho(-0.5, +0.5, -0.5, +0.5, 4.0, 15.0) GL.glMatrixMode(GL.GL_MODELVIEW) def mousePressEvent(self, event): @@ -204,23 +204,23 @@ class GLWidget(QtOpenGL.QGLWidget): def quad(self, x1, y1, x2, y2, x3, y3, x4, y4): self.qglColor(self.trolltechGreen) - GL.glVertex3d(x1, y1, -0.05) - GL.glVertex3d(x2, y2, -0.05) - GL.glVertex3d(x3, y3, -0.05) - GL.glVertex3d(x4, y4, -0.05) - - GL.glVertex3d(x4, y4, +0.05) - GL.glVertex3d(x3, y3, +0.05) - GL.glVertex3d(x2, y2, +0.05) GL.glVertex3d(x1, y1, +0.05) + GL.glVertex3d(x2, y2, +0.05) + GL.glVertex3d(x3, y3, +0.05) + GL.glVertex3d(x4, y4, +0.05) + + GL.glVertex3d(x4, y4, -0.05) + GL.glVertex3d(x3, y3, -0.05) + GL.glVertex3d(x2, y2, -0.05) + GL.glVertex3d(x1, y1, -0.05) def extrude(self, x1, y1, x2, y2): self.qglColor(self.trolltechGreen.darker(250 + int(100 * x1))) - GL.glVertex3d(x1, y1, +0.05) - GL.glVertex3d(x2, y2, +0.05) - GL.glVertex3d(x2, y2, -0.05) GL.glVertex3d(x1, y1, -0.05) + GL.glVertex3d(x2, y2, -0.05) + GL.glVertex3d(x2, y2, +0.05) + GL.glVertex3d(x1, y1, +0.05) def normalizeAngle(self, angle): while angle < 0: |