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

PyOpenGL 3D Snake Game' can't seem to find a way to increment the snake segments

i have recently started working with the pyopengl library and to test my knowledge i have decided to make a game. I have been having some issues with finishing the last part of the game tho, adding segments to the snake/making them follow you, down…
Kadosh
  • 11
  • 3
0
votes
1 answer

PyOpenGl runtime error after cx_freeze

I'm trying to compile a shader running PyOpenGL and PyOpenGL_Accellerate v 3.1.2 from https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy Runs fine, but after cx_freezeing it I get: "no array-type handler for type when calling glShaderSource I have…
0
votes
1 answer

pyglet not running as expected in MacOS

I was implementing simple text translation using pyglet. It works perfectly when there is no config added in window = pyglet.window.Window(). However, the code does not run after config is added in line 8. I am using Mac High Sierra. import…
0
votes
1 answer

PyOpenGL how to rotate a scene with the mouse

I am trying to create a simple scene in 3d (in python) where you have a cube in front of you, and you are able to rotate it around with the mouse. I understand that you should rotate the complete scene to mimic camera movement but i can't figure…
0
votes
2 answers

OpenCL/GL : Load a texture from buffer

I want to read a texture from a shared buffer OpenCL/OpenGL (as i have a CFD solver on openCL). My environment is Python 3.6 x64, with pyopencl and pyopengl. Displaying a dummy texture is working : glEnable(GL_TEXTURE_2D); # Load a texture…
user1391967
  • 497
  • 1
  • 6
  • 13
0
votes
0 answers

THREE.js GLSL uv built-in attribute

I want to re-use a shader I've found here. It's a THREE.js project of reaction/diffusion and it uses a GLSL program to do it. Vertex Shader goes like this : varying vec2 vUv; void main() { vUv = uv; gl_Position = projectionMatrix *…
snoob dogg
  • 2,491
  • 3
  • 31
  • 54
0
votes
1 answer

How to pan and zoom vertex lines in QtOpenGL

I'm looking for a way to move some lines form by glVertex but so far I have no solid solution for it, here's my code. I've tried moving glOrtho, it does not work, I've tired adding translation, it does not work if I panning constantly. And I have no…
shock3RFX
  • 15
  • 1
  • 3
0
votes
1 answer

Error in OBJFileLoader

There's error in OBJFILELOADER.py file from the link - https://www.pygame.org/wiki/OBJFileLoader . I think there's python2 to python3 version error, however I tried changing the raise ValueError thing and used obj as obj=(filename) But still…
Warlord
  • 33
  • 1
  • 6
0
votes
0 answers

pyOpenGL Is it necessary to draw an object every time when call glReadPixels?

I want to get depth buffer images that have been captured from different views of a 3D object. To do this with pyOpenGL I use the following code def get_depth(LookAt_x, LookAt_y, LookAt_z) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) …
HYY
  • 1
  • 1
0
votes
2 answers

Unable to use openGL 3.2+ on OSX (pyopenGL)

This systems works fine with pygame, glut and glfw using openGL 2.1, however as soon as I try to force openGL 3.2, openGL immediately fails. Here is my glfw implementation, I also have a GLUT program in similar sytle which fails with the same…
Frozenglass
  • 145
  • 1
  • 9
0
votes
1 answer

How to set a unit for an object in OpenGL

I'm learning OpenGL and I'm a bit confused about setting vertex data position. For instance, I want to draw a rectangle size 300mm x 300mm, as I understand, I can assume 1 OpenGL unit = 1 mm and then I set the vertex data like this: data = [-0.5, …
ryanvolap
  • 77
  • 1
  • 8
0
votes
1 answer

glDebugMessageControl is not available

I'm currently playing around with OpenGL using JOGL and PyOpenGL on my MacBook Pro. But very quickly I came to the point where a lot of example codes crash, because the address of glDebugMessageControl is not available. First I experienced the error…
luke1110
  • 73
  • 5
0
votes
0 answers

How to make a blinking rectangle in PyOpenGL?

I am learning PyOpenGL and my first animation test is trying to make a blinking rectangle, but I could not get it to animate, It only blinks when I move the cursor on a window. I guess I am missing a while loop but I could not figure out where to…
ryanvolap
  • 77
  • 1
  • 8
0
votes
1 answer

Plotting a 3d triangular mesh from point cloud

I have this object/point cloud,rendered with pyopengl and pygame. My object is a numpy array of the co-ordinates of the point. I wish to generate a 3d triangular mesh of this object, also it would be nice if you could decrease the number of…
rjpj1998
  • 297
  • 1
  • 6
  • 23
0
votes
1 answer

pyopengl display blocked when acting as a socket server at the same time

I am actually using a pyopengl program to act as a socket server. At the same time the server receives commands from clients and interprets these commands and does corresponding drawing at the same time. In case that the main thread got blocked when…
zinking
  • 5,561
  • 5
  • 49
  • 81