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
3 answers

glEnd error in PyOpenGL error = 1282

Hi i get a very strange problem when running this code. I don't see how it should conflict with the OpenGL Api either. Heres the code: import sys sys.path.append("..\Blocks") print sys.path import pygame from pygame.locals import * from OpenGL.GL…
Håvard Nygård
  • 386
  • 3
  • 14
0
votes
1 answer

Several questions on Tkinter - mainloop, update method, effectiveness etc

Background: I'm trying to write a graphics library for python built on top of Tkinter. I therefore would like to abstract all of Tkinter's functionality from the user and have method calls that modify the root window sequentially in a…
Michael Chav
  • 441
  • 5
  • 15
0
votes
1 answer

Rotating a Cube using Quaternions in PyOpenGL

I've recently taken an interest in graphics programming and I'm trying to start out by making a simple cube using PyOpenGL and PyGame. I've managed to get it rotating but I can't get consecutive rotations working correctly. I have a simple cube in…
ricey
  • 1
  • 1
  • 2
0
votes
1 answer

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

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.
sasquatch
  • 13
  • 1
  • 2
0
votes
1 answer

PyopenGL glReadPixels

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…
Uncle Dino
  • 812
  • 1
  • 7
  • 23
0
votes
1 answer

glCreateShader() fail in PyOpenGL

I’m trying to make a visualization in PyQt. I inherited QGLWidget and reimplemented initializeGL(), resizeGL(), paintGL(). Program and shaders are compiled in initializeGL(). Everything worked fine until I have installed latest driver for my Intel…
Marsel
  • 9
  • 4
0
votes
0 answers

How to save and reload a rendered model/list to save loading and rendering time at startup in python,pygame and pyopengl?

First off, this what I'm trying to achieve: I have a rendered height map object stored in a file, which when I open it up at the beginning of my game the terrain is already loaded saving countless minutes of loading and rendering, not counting all…
Pikachuu
  • 21
  • 4
0
votes
1 answer

Blitted OpenGL Textures take less memory and CPU

I'm making a game using pygame + pyopengl, and right now i'm trying to make a video player on this context. To do so I use ffmpeg to load different video formats, then convert each frame to an opengl texture, as designed below, and then play the…
Pedro H. Forli
  • 332
  • 2
  • 14
0
votes
0 answers

How do I save a loaded height map terrain into a file and open up the file later to save load time?

I have been using pickle to save to a file anything I've wanted to, such as class. It lets me later reload them when I start the application, allowing me to skip the initialization process. However, when trying to save this map class (that I found…
Pikachuu
  • 21
  • 4
0
votes
1 answer

Pygame/pyopengl shape changes when display size changes

I have been trying to do what is done here: http://pythonprogramming.net/opengl-pyopengl-python-pygame-tutorial/ And while everything looks basically the same, my cube looks like a rectangular prism. Switching the display dimensions to 600x600 makes…
dcheng
  • 1,827
  • 1
  • 11
  • 20
0
votes
1 answer

PyOpenGL: Contents of vertex buffer object ignored

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,…
Juzley
  • 15
  • 3
0
votes
1 answer

How to use OpenGLES2 with PyOpenGL?

how can I call GLES2 from PyOpenGL? It's in experimental state but I don't know how to import it. Does someone know this I only know that I can import it withfrom OpenGL import GL. Or does I only can import OpenGL? Then how to call GLES2?
0
votes
1 answer

PyOpenGL: glPixelStorei error in cx_freeze application

I have a python 3.3 application that visualizes a structure using PyOpenGL. It has a function to save the drawing in an image file. def save_image(self, filename): glPixelStorei(GL_PACK_ALIGNMENT, 1) data = glReadPixelsui(0, 0, width,…
Mads M Pedersen
  • 579
  • 6
  • 16
0
votes
2 answers

how to get opengl 3d model sectional drawing?

I have load an obj file to render my opengl model using pyopengl and pygame. The 3D model show successfully. Below is the 3D model i render with obj file, Now i cut my model into ten pieces through y axis , my question is how to get the sectional…
Jack Zhang
  • 2,534
  • 5
  • 25
  • 34
0
votes
1 answer

wxPython's GLCanvas is not resized when maximizing frame

I followed the tutorial of PyOpenGL to create a frame with 2 GLCanvas(es). When the frame was resized, the canvases work well (they filled all region of the parent. However, when I maximized, just the left one resized, the right one kept the old…
KhoiUCD
  • 1
  • 2