opengl

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

Draw multiple objects using VBOs with PyQt5 and OpenGL?

Draw multiple objects using VBOs with PyQt5 and OpenGL? Question: I am trying to render multiple objects in pyopengl using pyqt5. After following tutorials I created a 3D mesh which uploads a wavefront obj file and renders it with texture. This worked for me: class Model: def __init__(self, file_name, texture_name): self.object = ObjectLoader() self.object.load_model(file_name) //creating …

Total answers: 1

Misunderstanding the Model-View-Projection matrix in OpenGL

Misunderstanding the Model-View-Projection matrix in OpenGL Question: I am attempting to write a basic program in modern OpenGL using Python and pyglet. I am able to place a simple triangle on the screen with different colors for each of the corners. I am at the point where I am attempting to add the projection and …

Total answers: 2

Get openGLwidget linked with Qtimer update

Get openGLwidget linked with Qtimer update Question: I m trying to build a gui with Pyqt5. and withing the gui there is an openGLwidget, that should contain a rotating cube. But i cannot figure out how to make the cube rotate. Thank you. this is the setup function def setupUI(self): self.openGLWidget.initializeGL() self.openGLWidget.resizeGL(651,551) self.openGLWidget.paintGL = self.paintGL …

Total answers: 1

Can't compile shader without glfw context

Can't compile shader without glfw context Question: I am trying to compile OpenGL shaders using the Python bindings. I can not compile them without creating a glfw context, it is quite strange. If you uncomment the glfw lines, the shaders will get compiled. print(bool(glCreateShader)) outputs False. Error: Traceback (most recent call last): File “C:Program FilesPython38libsite-packagesOpenGLlatebind.py”, …

Total answers: 1

PyOpengGL raises error when I compile shaders

PyOpengGL raises error when I compile shaders Question: I am running through a cumulation of OpenGL shader tutorials and mixing and matching stuff, trying to get a custom shader implemented. I have the following Python code and traceback: import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QOpenGLWidget from PyQt5.QtCore import Qt from OpenGL.GL import ( glLoadIdentity, …

Total answers: 1

Is there any way of cyclic rotation of 2-D lines in opengl

Is there any way of cyclic rotation of 2-D lines in opengl Question: I want to make cyclic rotation of these 2-D lines such that when mouse is scrolled the lines move in upward or downward direction. For ex:- if mouse wheel is scrolled upward line at the top moves to the bottom and all …

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

PyQt5 OpenGL Cubemap – Black window displaying

PyQt5 OpenGL Cubemap – Black window displaying Question: Title says it all. There are not many tutorials out there for this kind of thing. Can someone with some experience help me out. I have tried a number of things. Interestingly I have been able to get OpenTK (C#) and OpenGL (C++) versions of this working, …

Total answers: 1