Пример #1
0
    def __init__(self, parent=None):
        QOpenGLWidget.__init__(self, parent)
        QOpenGLFunctions.__init__(self)

        self.core = "--coreprofile" in QCoreApplication.arguments()
        self.xRot = 0
        self.yRot = 0
        self.zRot = 0
        self.lastPos = 0
        self.logo = Logo()
        self.vao = QOpenGLVertexArrayObject()
        self.logoVbo = QOpenGLBuffer()
        self.program = QOpenGLShaderProgram()
        self.projMatrixLoc = 0
        self.mvMatrixLoc = 0
        self.normalMatrixLoc = 0
        self.lightPosLoc = 0
        self.proj = QMatrix4x4()
        self.camera = QMatrix4x4()
        self.world = QMatrix4x4()
        self.transparent = "--transparent" in QCoreApplication.arguments()
        if self.transparent:
            fmt = self.format()
            fmt.setAlphaBufferSize(8)
            self.setFormat(fmt)
Пример #2
0
    def __init__(self):
        '''
        '''
        QOpenGLFunctions.__init__(self)

        self.m_needsUpdateGeometry = True
        self.m_visible = True
        self.m_lineWidth = 1.0
        self.m_pointSize = 1.0
        self.m_texture: QOpenGLTexture = None
        self.m_lines: List[VertexData] = []
        self.m_points: List[VertexData] = []
        self.m_triangles: List[VertexData] = []

        self.m_vbo = QOpenGLBuffer(QOpenGLBuffer.VertexBuffer)
        self.m_vao = QOpenGLVertexArrayObject()
Пример #3
0
    def __init__(self, parent, tag=None):
        QtOpenGLWidgets.QOpenGLWidget.__init__(self, parent)
        GL.__init__(self)
        self.__data = np.array([
            -1.0, -1.0, 0.0, 0.0, 0.0, -1.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0.0,
            1.0, 1.0, 1.0, -1.0, 0.0, 1.0, 0.0
        ],
                               dtype=ctypes.c_float)

        self.tag = tag
        self.__mutex = threading.Lock()
        self._is_video = False
        self._is_video_playing = False

        self.__texture_generator = None
        self.__player = None
        self.__uniform_tex_bias = -1