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
-1
votes
1 answer

Attempt to call an undefined function glutInit?

I want to create a cornell box scene. I wrote all the necessary code in Python and installed all the necessary libraries. I try to run the code in Pycharm, but the error appears: OpenGL.error.NullFunctionError: Attempt to call an undefined function…
Jane Doe
  • 11
  • 4
-1
votes
1 answer

Incorectly rendered texture with PyOpenGL

I'm trying to write a basic 3d game with pyopengl but trying to add textures to the cubes i ran into problems with the texture-maping. The texture is weirdly swapped and stretched across the surface My Code : def createtexturedcube(x, y, z, sx, sy,…
-1
votes
1 answer

Why do objects in my window sometimes disappear and reappear?

The objects in my window sometimes disappear and reappear. This mainly happens when resizing the window. I suppose this is because my two methods conflict with each other with the glutMainLoopEvent() function. I create the window like this: def…
-1
votes
1 answer

My texture is being displayed as completely black in pyOpenGL

I was trying to display a texture in pyOpenGL with the following methods. Instead of the texture being rendered correctly, the entire object was black. The texture is being loaded with PIL in an RGBA format. I try to load in the texture using this…
-1
votes
1 answer

Python OpenGL glRotatef does not rotate the correct amount

I use Pycharm and coupled OpenGL with pygame. I have a problem with the OpenGL method glRotatef. It seems like it does not rotate the right amount. I have a class which has the 3-dimensional coordinates xPos,yPos,zPos. The class is drawn with this…
-1
votes
1 answer

No PyGame window appear after I run my project

I install PyGame and OpenGL to my PyCharm for my cube but my problem is the cube never pop up.
-1
votes
1 answer

issue with OpenGL library load on mac m1 , using pyopengl

i have these imports import pygame from pygame.locals import * from OpenGL.GL import * # issue with this one from OpenGL.GLU import * error is : OSError: ("dlopen(OpenGL, 0x000A): tried: '/Users/aryansingh/miniconda3/lib/OpenGL' error stack …
aryan singh
  • 151
  • 11
-1
votes
1 answer

Mac Big Sur: Unable to load numpy_formathandler accelerator from OpenGL_accelerate

I keep getting an Unable to load numpy_formathandler accelerator from OpenGL_accelerate message when using OpenGL. From what I can tell, everything seems to be running fine, but message always pops up. Here is a sample script where it happens. It…
amv_23
  • 29
  • 5
-1
votes
2 answers

Can we input random values to render color on a cube using PyOpenGL?

I have a cube that can be rotated using mouse navigation in PyOpenGL. I want to create small sections on each face of the cube and render the different sections with different colors/illumination. It is like having a certain light source and the…
Magneto
  • 17
  • 5
-1
votes
1 answer

Split VBO to smaller buffers?

OpenGL newbie here. I am learning OpenGL and I'm trying to figure out workaround to VBO. Let me explain. If You load .obj file you have everything set up: vertex coordinates, normals, UV's and their indices. Why is this not enough to draw triangles…
-1
votes
2 answers

pyopengl/opengl weird ghosting effect deleted triangles showing up even after deletion

in a nutshell, im writing vertexes for a cube into a vbo that i have setup correctly with a glbuffersubdata() call every frame, i then use gldrawarrays() and opengl does its thing and sends pixel data to a doublebuffer screen setup which i cycle…
Tabeeb
  • 19
  • 4
-1
votes
1 answer

pyopengl - Is there a way how to get intersection of line and quad/triangle?

I would like to find out if there is clear visibility between point A and B (no obstacle in the way). Is there a function that do exactly that? Alternatively, a function in pyopengl that can find intersection of line and quad/triangle could work as…
matousc
  • 3,698
  • 10
  • 40
  • 65
-1
votes
1 answer

Pyopengl - how to dispose old textures and glGenLists?

I am using glGenLists like this: my_list = glGenLists(1) glNewList(array_list, GL_COMPILE) # some OpenGL instructions go here glEndList() In similar way I am using textues: my_texture = glGenTextures(1) If I understand correctly, the textures and…
matousc
  • 3,698
  • 10
  • 40
  • 65
-1
votes
1 answer

Strange OpenGL pixelation behavior

I'm using PyOpenGL and GLUT to draw a square that moves in a circle. I do not clear the screen after drawing squares, because I desire a trailing effect. For some reason, squares that have been drawn already will move when new ones are…
Enrico Borba
  • 1,877
  • 2
  • 14
  • 26
-1
votes
1 answer

How to apply my own colormap in the fragment shader?

I have a given image img (16 bits gray-level image whose values range from 0 to 65535) and a colormap colormap_file which is a 8 bits RGB 256*256 pixels image. Thus, thanks to such a colormap I am able, for all pixels in the valueImage, to assign a…
floflo29
  • 2,261
  • 2
  • 22
  • 45
1 2 3
62
63