opengl-compat

How to texture a sphere in PyQt5 QOpenGLWidget

How to texture a sphere in PyQt5 QOpenGLWidget Question: I’m trying to display a map of the world in a program I’ve made using PyQt5. For the rendering stuff so far this is the (mostly borrowed) code I have: import sys import math import numpy as np from PIL import Image, ImageQt from PyQt5.QtCore import …

Total answers: 1

Why does glRotate work only once when I don't create an extra class for my openGLWidget?

Why does glRotate work only once when I don't create an extra class for my openGLWidget? Question: I’m writing a GUI for displaying a 6-Axis Motion sensor’s output using Python. The Window is supposed to have an OpenGL Widget displaying the rotation in realtime. Normally I would write a separate class for my openGLWidget but …

Total answers: 1

Why the quads do not render?

Why the quads do not render? Question: Im using PyOpenGL with PyQt5 widgets. In my OpenGL widget I have the following code: class Renderizador(QOpenGLWidget): def __init__(self, parent=None): super().__init__(parent) self._x = -0.1 self._y = -0.1 self._z = -0.1 self._rx = 45 self._ry = 45 self._rz = -45 self.vertices_vertical = [[100, 100, 0], [100, -100, 0], [-100, …

Total answers: 1

Change perspective of a PyOpenGL widget

Change perspective of a PyOpenGL widget Question: I am trying to change the perspective of my scene in a PyQt5 OpenGL widget. I know I have to override some methods, but I do not know which one should I use. def initializeGL(self): glClear(GL_COLOR_BUFFER_BIT) glEnable(GL_DEPTH_TEST) def paintGL(self): glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glBegin(GL_LINES) # More code Where should …

Total answers: 1