Creating a projection matrix in Qt OpenGL

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Creating a projection matrix in Qt OpenGL

Bugzilla from
I'm working on a small demo of OpenGL in PyQt using the QOpenGLWidget.

My demo works except that whenever I translate it with a negative Z, the
back side of the drawing is getting cut off.  It seems like I must not
be setting the projection matrix correctly.

Below is my overridden resizeGL() method that sets up the matrix.  Am I
doing this correctly?

     def resizeGL(self, width, height):
         super().resizeGL(width, height), 0, self.width(), self.height())
         near_plane = 1
         far_plane = 200
         angle = 45
         aspect = self.width() / self.height()
         self.projection = qtg.QMatrix4x4()
             angle, aspect, near_plane, far_plane)

PyQt mailing list    [hidden email]