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

Get coords of GL_QUAD for collision detection?

I have a GL_QUAD which is basically a big field that the player is able to walk on. However, I want the player to have the abilty to 'jump,' meaning when he returns to his original y position he must stop falling. How do I access the world…
Fitzy
  • 1,871
  • 6
  • 23
  • 40
0
votes
0 answers

glGenTextures(1) with PyOpenGL always gives error

Ever since using OpenGL with Python, I have had the problem of not being able to use more than one texture at a time. Obviously, this is very limiting and I can't seem to find any solution. The problem lies in the call glGenTextures(1). Every time I…
Fitzy
  • 1,871
  • 6
  • 23
  • 40
0
votes
1 answer

how to combine wxPython, matplotlib and Pyopengl

Hi so I currently have an application whereby I have a window displaying a matplotlib graph. i.e. such as this: from numpy import arange, sin, pi import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import…
James Elder
  • 1,583
  • 3
  • 22
  • 34
0
votes
1 answer

`TypeError: perspectiveMatrix() got an unexpected keyword argument 'inverse'` in OpenGLContext callback

I am starting to learn OpenGL and I tried to run the program in this tutorial. This is the code I have got together from that page. I had to lower the GLSL version in the shaders to get it to run at all on my laptop (they were 330). from…
varesa
  • 2,399
  • 7
  • 26
  • 45
0
votes
1 answer

Use Qt.MidButton and Qt.MidButton+Qt.ControlModifier in PyQt to rotate and translate/pan

I am working on a simple 3D viewer using PyQt and its bindings for OpenGL. I would like to implement the following user actions (like for example in solidworks): pan/translate: with combination ctrl+middle mouse button (pressed) rotate: middle…
lskrinjar
  • 5,483
  • 7
  • 29
  • 54
0
votes
1 answer

Fastest way to implement a sprite

I'm using PyOpenGL to implement a small 2D game engine. I'm hesitating on the way I implement a Sprite class. I'm already keeping all the scene (tiled map) in a VBO, and all textures are kept in the same big texture. All the sprite's images are also…
Fred
  • 901
  • 1
  • 8
  • 16
0
votes
1 answer

Refactoring to use OpenGL VBOs

I'm learning OpenGL from the OpenGL Programming Guide, and have a simple 3d view of a cube working. The I know that using VBOs should help performance and would like to modify my code to use them. I'm having trouble getting this to work, and…
Codie CodeMonkey
  • 7,669
  • 2
  • 29
  • 45
0
votes
1 answer

May anyone explain to me why the texture doesn't show? [PyOpenGL]

The relevant methods to see are: init, genTexture, onDisplayEvent and table_leg_model. The 'wood1.png' is a 64x64 image. Code : import Image from math import cos from math import pi from math import sin from numpy import array from numpy import…
EPadronU
  • 1,783
  • 1
  • 15
  • 15
0
votes
1 answer

OpenGL and GL_SMOOTH shading

I'm having problems with my shading. I exported my model from SolidWorks to .wrl file. I read this file and show it with glShadeModel(GL_SMOOTH), result is not smooth object joust like in GL_FLAT mode. RESULT:…
user2081554
0
votes
1 answer

How to uncheck a checkbox to stop infinite drawing in pyqt?

My problem is I want to keep rotating the scene if the checkbox is checked, and stop this rotation immediately once it is unchecked. However, "keep rotating" means an infinite loop... So after entering the loop, the program gets kind of freezed and…
mayasky
  • 1,025
  • 1
  • 9
  • 9
0
votes
1 answer

Python: pyglet vs PyOpengl performance evaluation for frame dropping

I have to evaluate the performance/functionality of Pyopengl vs Pyglet. The main concern is that it can't drop any frame while using high FPS. Before I start learning one of then, I need to see if it can do what the client needs. I am trying to…
BaldDude
  • 1,025
  • 1
  • 19
  • 33
0
votes
1 answer

pyinstaller 2.0 with pyqtgraph returns 6223 error invalid syntax

I have been struggling to figure out why my program is not packaging with pyinstaller. I have found the same error when I import pyqtgraph (http://www.pyqtgraph.org/). It uses pyopengl, so im not sure if that is the cause. The error I get is:…
user-2147482637
  • 2,115
  • 8
  • 35
  • 56
0
votes
1 answer

openGL light won't move with camera

Help me understand why my light is at a fixed position and won't follow the eye/camera. The openGL FAQ seems to say you just set the light's position before doing any transforms for the objects in your world, and that you can set it only once...…
0
votes
1 answer

OpenGL giving triangles colors in a list

I'm working in python / PyOpenGL, but the calls are basically mapped straight to OpenGL itself so I'm asking for help from people who know either. I've got a big 3D system which I've decomposed into facets myself. My first attempt at the code looked…
tehwalrus
  • 2,589
  • 5
  • 26
  • 33
0
votes
1 answer

converting GLSL #130 segment to #330

I have the following piece of shader code that works perfectly with GLSL #130, but I would like to convert it to code that works with version #330 (as somehow the #130 version doesn't work on my Ubuntu machine with a Geforce 210; the shader does…
Daniel Schreij
  • 773
  • 1
  • 10
  • 26