當前位置: 首頁>>代碼示例>>Python>>正文


Python opengl.GLAxisItem方法代碼示例

本文整理匯總了Python中pyqtgraph.opengl.GLAxisItem方法的典型用法代碼示例。如果您正苦於以下問題:Python opengl.GLAxisItem方法的具體用法?Python opengl.GLAxisItem怎麽用?Python opengl.GLAxisItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyqtgraph.opengl的用法示例。


在下文中一共展示了opengl.GLAxisItem方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from pyqtgraph import opengl [as 別名]
# 或者: from pyqtgraph.opengl import GLAxisItem [as 別名]
def __init__(self, parent=None):
        super().__init__(parent=parent)
        self._named_items = {}
        self.noRepeatKeys.append(QtCore.Qt.Key_W)
        self.noRepeatKeys.append(QtCore.Qt.Key_S)
        self.noRepeatKeys.append(QtCore.Qt.Key_A)
        self.noRepeatKeys.append(QtCore.Qt.Key_D)
        self.w_gl_axis = gl.GLAxisItem(
            size=None, antialias=True, glOptions='translucent')
        self.addItem(self.w_gl_axis) 
開發者ID:traveller59,項目名稱:second.pytorch,代碼行數:12,代碼來源:glwidget.py

示例2: do_render

# 需要導入模塊: from pyqtgraph import opengl [as 別名]
# 或者: from pyqtgraph.opengl import GLAxisItem [as 別名]
def do_render(self, projected):
        projected = self.rescale(projected)

        x, y, z, _ = projected.shape
        print(x, y, z)
        d = float(max(x, y, z) * 2)

        if self.plot is None:
            self.plot = gl.GLVolumeItem(projected, smooth=False)
            self.addItem(self.plot)
            self.axis = gl.GLAxisItem(glOptions="opaque")
            self.addItem(self.axis)
            self.opts['distance'] = self.distance = d
        else:
            # Latest version has .setData but is not in PyPi
            self.plot.data = projected
            self.plot.initializeGL()

        ratio = d / self.distance

        self.opts['distance'] *= ratio
        self.distance = d

        self.plot.resetTransform()
        self.plot.translate(-x/2, -y/2, -z/2)

        self.axis.setSize(x, y, z)
        self.axis.resetTransform()
        self.axis.translate(-x/2, -y/2, -z/2)

# Give projectors a chance to register. 
開發者ID:wapiflapi,項目名稱:binglide,代碼行數:33,代碼來源:renderers.py

示例3: __init__

# 需要導入模塊: from pyqtgraph import opengl [as 別名]
# 或者: from pyqtgraph.opengl import GLAxisItem [as 別名]
def __init__(self):
        self.app = pg.mkQApp()
        self.view = gl.GLViewWidget()
        coord = gl.GLAxisItem()
        glLineWidth(3)
        coord.setSize(3, 3, 3)
        self.view.addItem(coord) 
開發者ID:poodarchu,項目名稱:Det3D,代碼行數:9,代碼來源:kitti.py


注:本文中的pyqtgraph.opengl.GLAxisItem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。