pyopengl

problem with backface culling on OpenGL python

problem with backface culling on OpenGL python Question: My goal is to render a .pmx 3D model using PyOpenGL on pygame. I’ve found pymeshio module that extracts vertices and normal vectors and etc. found an example code on it’s github repo that renders on tkinter. I changed the code to render on pygame instead, didn’t …

Total answers: 1

glVertexAttribPointer() can't find valid context on Wayland environment?

glVertexAttribPointer() can't find valid context on Wayland environment? Question: I try to draw colorized triangle. I want to use modern OpenGL and translate data via vertex attrib array. Vertex shader and Fragment shader just pass color from input to output and don’t contain any interesting code pg.init() triangle = np.array( triangle, dtype=np.float32 ) triangle_buffer = …

Total answers: 1

Python OpenGL glRotatef – looking for the correct multiplier

Python OpenGL glRotatef – looking for the correct multiplier Question: I am using gluLookAt with a camera whose coordinates are xCam, yCam and zCam. The coordinates of the object the camera is looking at are xPos, yPos, and zPos. There are variables named mouseturnX and mouseturnY, which measure the deviation of the mouse from the …

Total answers: 1

Draw a background video behind a 3D model in OpenGL

Draw a background video behind a 3D model in OpenGL Question: I am tring to draw 3d model (.obj) by this script https://github.com/yarolig/OBJFileLoader/blob/master/OBJFileLoader/objloader.py and as bacgrund I want to draw video from the webcam.but when I am drawing the image and the 3d model only the image show up. This is my Image loder class …

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