load matrix instead of multiplying to identity
This commit is contained in:
parent
025ca08574
commit
5d7dd101f2
@ -155,9 +155,7 @@ class GLViewWidget(QtWidgets.QOpenGLWidget):
|
|||||||
def setProjection(self, region=None):
|
def setProjection(self, region=None):
|
||||||
m = self.projectionMatrix(region)
|
m = self.projectionMatrix(region)
|
||||||
glMatrixMode(GL_PROJECTION)
|
glMatrixMode(GL_PROJECTION)
|
||||||
glLoadIdentity()
|
glLoadMatrixf(m.data())
|
||||||
a = np.array(m.copyDataTo()).reshape((4,4))
|
|
||||||
glMultMatrixf(a.transpose())
|
|
||||||
|
|
||||||
def projectionMatrix(self, region=None):
|
def projectionMatrix(self, region=None):
|
||||||
if region is None:
|
if region is None:
|
||||||
@ -183,11 +181,9 @@ class GLViewWidget(QtWidgets.QOpenGLWidget):
|
|||||||
return tr
|
return tr
|
||||||
|
|
||||||
def setModelview(self):
|
def setModelview(self):
|
||||||
glMatrixMode(GL_MODELVIEW)
|
|
||||||
glLoadIdentity()
|
|
||||||
m = self.viewMatrix()
|
m = self.viewMatrix()
|
||||||
a = np.array(m.copyDataTo()).reshape((4,4))
|
glMatrixMode(GL_MODELVIEW)
|
||||||
glMultMatrixf(a.transpose())
|
glLoadMatrixf(m.data())
|
||||||
|
|
||||||
def viewMatrix(self):
|
def viewMatrix(self):
|
||||||
tr = QtGui.QMatrix4x4()
|
tr = QtGui.QMatrix4x4()
|
||||||
|
Loading…
Reference in New Issue
Block a user