FAQ Database Discussion Community


PyopenGL glReadPixels

python,opengl,pyopengl
I tried to use the glReadPixels method to color code a simple triangle in the screen, just without any secondary render functions, etc. but it didn't give the good result. Code: import pygame as pg from OpenGL.GL import * pg.display.set_mode((500,500),pg.OPENGL) glClearColor(0.5,0.0,0.5,0.0) done=0 def first(): glColor3f(0.5,0.6,0.7) glBegin(GL_TRIANGLES) glVertex(0.0,0.0,0.0) glVertex(1.0,0.0,0.0) glVertex(0.0,1.0,0.0) glEnd()...

PyOpenGL: Contents of vertex buffer object ignored

python,opengl,pyopengl
I'm trying to use the tutorials at http://ogldev.atspace.co.uk to get a grip on 'modern' OpenGL, working in Python 3 with PyOpenGL, with some reference to this. At the moment I'm just trying to draw a single point at various places on the screen, but the point always draws in the...

How do I control the camera in PyOpenGL using a mouse?

python,opengl,view,mouse,pyopengl
We need to make a 3D game in python so in my research I discovered PyOpenGL. After a bit of playing around with I became stumped on how to move the camera around. Give me some sample code and an explanation.

Why can't I draw a texture in pyOpenGL

python,opengl,pyopengl
If I disable textures it correctly draws a white cube but when I enable textures it draws nothing (or black square same color as background). The only thing I suspect is GL_INT because up to this point I have only been using unsigned byte in my projects. Edit: my window...

Syncing image display with screen refresh rate

opengl,pyqt,pyqt4,pyopengl
What the program does: Using PyQt4 to display images (simple jpg/png files). The objective: Have an image displayed/drawn on the screen in sync with the screen's refresh rate. A pseudo-code sample of what i would like to achieve: pixmap = set_openGL_pixmap(myPixmap) draw_openGL_pixmap(pixmap) doSomthingElse() Ideally, the draw_openGL_pixmap(pixmap) function should only return...