Questions tagged [pyopengl]

Python binding to the OpenGL API

PyOpenGL is a cross platform Python binding to OpenGL API, which also supports libraries like the following ones:

This bindings are interoperable with external GUI libraries, such as , and .

It includes a learning library called OpenGLContext, which contains sample code for common operations and it is not needed to work with PyOpenGL.

Resources

945 questions
0
votes
0 answers

Installing PyFTGL: distribution not found

I am trying to install PyFTGL, to display text in my OpenGL project. I usually install libraries using pip, but sudo pip3 install PyFTGL returns the following error: Could not find a version that satisfies the requirement PyFTGL (from…
tvoirand
  • 347
  • 1
  • 3
  • 12
0
votes
1 answer

pygame opengl window not updating when called by python-osc dispatcher

I'm currently working an a 3d visualization of a few points, receiving data via osc (python-osc) and displaying them using pygame. Based on a working pygame example of a cube I added the osc dispatcher functions to receive data, then calling the…
Martin
  • 1
0
votes
1 answer

PyOpenGL - Draw multiple triangles with different colors with VBO

My goal is to render a scene with many triangles, with different colors. I want to render this same scene many times, as quickly as possible from many different camera positions and different view angles. I managed to combine several samples and get…
user972014
  • 3,296
  • 6
  • 49
  • 89
0
votes
1 answer

PyOpenGL: glUniform1f gives TypeError

My problem is that when I want to call glUniform1f() it gives this error: ctypes.ArgumentError: argument 1: : wrong type I just cant figure out what possibly might cause this. My Code: # initialization glutInit() # initialize…
0
votes
1 answer

Is it possible to change the color of an object with a variable in OpenGL?

So let's say I have a variable called current_color and the string assigned to current_color is constantly changing. Additionally I have a cube in PyOpenGl.py To assign the cube's color I use glColor3fv((0, 1, 0)) Would there be a way…
Richard Wenzel
  • 65
  • 1
  • 2
  • 5
0
votes
0 answers

OpenGL: setting a texture

I'm new to OpenGL and I want it to display the frames that I get from my camera in the background of the window. Therefore I created a quad, converted the frame to a texture and I'm trying to set it as a texture for my quad but I can't seem to find…
user3019423
  • 61
  • 10
0
votes
1 answer

Mouse position on (OpenGL) scene

I'm trying to get the mouse coordinate on OpenGL scene. My Code: from PySide.QtGui import (QColor) from PySide.QtCore import (Qt, QSize) from PySide.QtOpenGL import (QGLWidget) from OpenGL.GL import * from OpenGL.GLU import * class QGL(QGLWidget): …
Bear
  • 550
  • 9
  • 25
0
votes
0 answers

optimize the 128mb EXR image

in initializeGL in QGLWidget: I'm loading a .exr image (128mb) 4000x2000 with imageio.imread from imageio import imread img_array = imread("c:/sample.exr") self.textureID = glGenTextures(1) in paintGL in QGLWidget: I draw my single quad with…
Bear
  • 550
  • 9
  • 25
0
votes
0 answers

How to get the verticies moving independently in OpenGL / PyOpenGL without instancing, TF etc

I'm building a particle sim using OpenGL and am trying to benchmark the various methods of setting up the particles. Before I progress to instancing or transform feedback, I wanted to create independently moving points using only a standard VBO. So…
Nas25
  • 55
  • 6
0
votes
1 answer

Pyopengl - VBO with texture

I use Python 3.6. Originally I use code like this: array_to_texture(self.board) glColor3fv((1.0, 1.0, 1.0)) glBegin(GL_QUADS) for vertex, tex in zip(self.POINTS, self.TEX): glTexCoord2f(*tex) glVertex3fv(vertex) …
matousc
  • 3,698
  • 10
  • 40
  • 65
0
votes
2 answers

How to effectively pass the same vertices to pyopengl many times?

I am rendering some scenery with Pyopengl. Everything works, but for every frame I need to pass all vertices to opengl, in a way: for object in objects: for face in object: for vertex in face: glBegin(GL_QUADS) …
matousc
  • 3,698
  • 10
  • 40
  • 65
0
votes
1 answer

PyopenGL - how to move camera frustrum to change perspective in normalized device coordinates?

I want to render some stuff from a bird perspective with Pyopengl. The "bird" camera should be able to move in X, Y a rotate around Z vector. It works, but I would like to place the "bird" a the bottom of the screen, because the top of the screen…
matousc
  • 3,698
  • 10
  • 40
  • 65
0
votes
1 answer

Z buffering results in loss of transparency

I'm trying to use z-buffering to order textures according to their z values. I created a simple script to do so as written below. import pygame import sys from OpenGL.GL import * from pygame.locals import * def load_texture(path): surf =…
Pedro H. Forli
  • 332
  • 2
  • 14
0
votes
1 answer

OpenGL shader compile error (C0000 and C0206) (PyOpenGL)

I'm still pretty new to opengl and i'm trying to compile my vertex and fragment shader but keep getting an error. Heres the shaders i'm compiling: # Vertex shader vert_shader = """ #version 330 in vec4 position void main() { gl_Position =…
0
votes
2 answers

(pyopengl) normal is not working... help me

I'm building a cube with Python. I am going to use vbo and shader. but, Normal does not work. Where is the problem? and How should I coding it? import pygame from pygame.locals import * from OpenGL.GL import * from OpenGL.GLU import * from ctypes…
추준엽
  • 11
  • 3