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

PyOpenGL OpenGL Version on MacOs

I've been told to switch legacy profile to core profile from other stackoverflow posts but I can't seem to find a way to do that. So I'm positing a more updated error post to help me figure out a way. CODE: import glfw, numpy from OpenGL.GL import…
Elpupper
  • 46
  • 1
  • 12
4
votes
1 answer

Cannot import OpenGL.GL

Setup I am using Python 2.7.15rc1 in WSL. I have set up a virtualenv environment for my project. This project requires 3 external packages: numpy, Pillow, and PyOpenGL. Here is a snippet of the starting code for my import sys, os, numpy, math try:…
bitscuit
  • 976
  • 1
  • 11
  • 26
4
votes
1 answer

PyOpenGL transforming view coordinates into object coordinates for ArcBall navigation

I am following this tutorial for arcball navigation in 3d: https://en.wikibooks.org/wiki/OpenGL_Programming/Modern_OpenGL_Tutorial_Arcball I managed to perform all the steps and the navigation works but I cant seem to comprehend last step in…
J.J.
  • 129
  • 2
  • 14
4
votes
2 answers

Is there a way for us to display ply file using pyopengl?

I am currently doing a project which needs to do handle ply file and display it. I want to use pyopengl to handle this problem. Can someone tell me is there a way for me to display 3-D model of this ply file using pyopengl? I searched google, but…
python3
  • 251
  • 4
  • 12
4
votes
0 answers

how to avoid huge memory allocation when sending numpy array to vbo?

When I sent a big numpy array to the vbo, the memory goes up, up to a gig. The shape of the array is (120000, 1), each vertex is x,y,z,r,g,b. The array can be bigger but whatever its size the allocation is disproportionate. I added…
LBarret
  • 1,113
  • 10
  • 23
4
votes
1 answer

How do I get PyOpenGL to work with a wxPython context, based on this C++ Modern OpenGL tutorial?

I've been following this tutorial for drawing a simple triangle using shaders and modern OpenGL features such as Vertex Array Objects andVertex Buffer Objects. The tutorial code is in C++, but I figured that as OpenGL is the same whichever bindings…
arjtilley
  • 41
  • 1
  • 3
4
votes
1 answer

NullFunctionError: Attempt to call an undefined alternate function (glGenFramebuffers, glGenFramebuffersEXT)

Currently I'm working with 3D objects rendering. In that while dealing with framebuffer part I'm getting some error. self.fbo = glGenFramebuffers(1) whenever interpreter hits this line its showing following error **File…
satha
  • 41
  • 3
4
votes
1 answer

PyOpenGL. x = glGetDoublev(GL_MODELVIEW_MATRIX) Returns Memory Address

I'm trying to store the location of a cube in the value x and when I try and print(x) instead of printing the location, it prints Extra Info: Windows 8.1 64-Bit Python…
Funk Pigeon
  • 168
  • 2
  • 12
4
votes
2 answers

PyQt5 QWindow + PyOpenGL error 1282 'invalid operation' with every OpenGL function

I've run out of ideas and I need some help. Consider the following snippet (modified http://www.riverbankcomputing.com/pipermail/pyqt/2014-July/034542.html): from OpenGL import GL from PyQt5 import Qt class GLWindow(Qt.QWindow): def…
kamokr
  • 41
  • 1
  • 3
4
votes
4 answers

PyOpenGL: glVertexPointer() offset problem

My vertices are interleaved in a numpy array (dtype = float32) like this: ... tu, tv, nx, ny, nz, vx, vy, vz, ... When rendering, I'm calling gl*Pointer() like this (I have enabled the arrays before): stride = (2 + 3 + 3) * 4 glTexCoordPointer( 2,…
SurvivalMachine
  • 7,946
  • 15
  • 57
  • 87
4
votes
1 answer

Render to FBO + glReadPixels all black

I am trying to render a simple checkerboard in a FBO and then do a glReadPixels(). When I do it without FBO, everything works fine. So I assume that my render function is ok and so is the glReadPixels(). With the FBO, all I get are the lines that I…
BaldDude
  • 1,025
  • 1
  • 19
  • 33
4
votes
1 answer

How to export a blender file and open it in PyOpenGL?

I have a 3-D object I created in blender. I would like to export it from blender and be able to import it into OpenGL. Is there a method or specific file extension recommended for this process?
4
votes
4 answers

How to enable vsync in PyOpengl?

As the title says really. I'd like to turn on vertical sync in PyOpenGL, but how can I do it? A fairly exhaustive web search didn't turn up anything, but maybe someone has a clever solution? I'm on OS X and I don't mind which package is used to…
N. Virgo
  • 7,970
  • 11
  • 44
  • 65
4
votes
2 answers

PyOpenGL access violation on Intel HD Graphics 3000

I have an issue with PyOpenGL 3.0.2 on a Windows 8 64 bits laptop with an Intel HD 3000 graphics chipset. Any call to glGenBuffers(1) (after proper GL initialization) crashes: File ".\sample.py", line 7, in init buffer = glGenBuffers(1) File…
Cyrille Rossant
  • 488
  • 1
  • 6
  • 19
4
votes
3 answers

Trying to use PyOpenGL and having problems

I am following the tutorial from http://pyopengl.sourceforge.net/context/tutorials/shader_1.xhtml The problem is I am using PyOpenGL 3.0.2, which when I import OpenGL from python3.2 it works perfectly fine. I just can't find a way to get OpenGL…
zyeek
  • 1,277
  • 12
  • 27