I am sure there is an another way, but you can override GlViewWidget
mouseMoveEvent method (original code is commented out).
import pyqtgraph.opengl as gl
import pyqtgraph as pg
from pyqtgraph import QtCore
class GLViewWidgetLeftHanded(gl.GLViewWidget):
def __init__(self):
super(GLViewWidgetLeftHanded, self).__init__()
def mouseMoveEvent(self, ev):
diff = ev.pos() - self.mousePos
self.mousePos = ev.pos()
# if ev.buttons() == QtCore.Qt.LeftButton:
if ev.buttons() == QtCore.Qt.RightButton:
self.orbit(-diff.x(), diff.y())
elif ev.buttons() == QtCore.Qt.MidButton:
if (ev.modifiers() & QtCore.Qt.ControlModifier):
self.pan(diff.x(), 0, diff.y(), relative=True)
else:
self.pan(diff.x(), diff.y(), 0, relative=True)
app = pg.QtGui.QApplication([])
fig = GLViewWidgetLeftHanded()
axis = gl.GLAxisItem()
fig.addItem(axis)
fig.setWindowTitle('left v right')
fig.show()
pg.QtGui.QApplication.instance().exec_()
On Wed, May 31, 2017 at 1:59 PM, ron <[email protected]> wrote:
> Is the pyqtgraph GLViewWidget() inherently a left handed or right handed
> coordinate system? Is there a way to set this?
>
> The code below is just enough to show the GLAxisItem. It looks like a
> lefty!
>
> Is there a way to change the setup to a right-handed coordinate system?
>
> import pyqtgraph.opengl as gl
> import pyqtgraph as pg
> import PySide
> app = PySide.QtGui.QApplication([])
> fig = gl.GLViewWidget()
> axis = gl.GLAxisItem()
> fig.addItem(axis)
> fig.setWindowTitle('left v right')
> fig.show()
> pg.QtGui.QApplication.instance().exec_()
>
> --
> You received this message because you are subscribed to the Google Groups
> "pyqtgraph" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/pyqtgraph/cbeb8a31-91eb-473b-8320-9b1d3382d5f8%40googlegroups.com
> <https://groups.google.com/d/msgid/pyqtgraph/cbeb8a31-91eb-473b-8320-9b1d3382d5f8%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/CAD_qyJpW54yj-1HPrjn%2BsLT0gUEwktQJzZtVwmjAy023E1ZQWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.