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

PyOpenGL: gluLookAt behaviour?

I am trying to get different perspectives in 3D on a OpenGL window. If you run the code (with anything to do with gluLookAt commented out) and left click the red line point at the place you clicked, right click and the green line aligns to where you…
DrBwts
  • 3,470
  • 6
  • 38
  • 62
0
votes
1 answer

PyOpenGL on Ubuntu for Python 2.7

I am trying to install PyOpenGL and so far have tried the following ways: $ pip install PyOpenGL PyOpenGL_accelerate $ sudo python2.7 -m pip install PyOpenGL PyOpenGL_accelerate Some variations of the above... Installation from source.…
0
votes
2 answers

Draw cubes with colour intensity with Python

I'd like to know how to plot many cubes with Python. For each cube I have its coordinates (Xmin, Xmax, Ymin, Ymax, Zmin, Zmax) and its value to draw the cube according this value. In fact what I really want to draw voxels. I've seen some libraries…
Pablo
  • 463
  • 1
  • 5
  • 12
0
votes
1 answer

PyOpenGL Transformation Blur

I would like to know how to make openGL to not "blur" an upscaled texture, as it seems that the bluring is set to default for transformations. The texure is a POT png file. The code used to define a texture and put it on the screen is this: class…
0
votes
1 answer

Calling a freeglut function in PyOpenGL prints 'freeglut' and exits

Version: Python 2.7.6 on Ubuntu 14.04 >>> import OpenGL >>> import OpenGL.GLUT >>> import OpenGL.GLUT.freeglut >>> OpenGL.GLUT.freeglut.glutSetOption(OpenGL.GLUT.GLUT_ACTION_ON_WINDOW_CLOSE, OpenGL.GLUT.GLUT_ACTION_GLUTMAINLOOP_RETURNS) Running the…
wenderen
  • 161
  • 2
  • 7
0
votes
0 answers

(py)SDL2 & (py)OpenGL: mirror window contents

I'm using pySDL2 to code an multi-monitor app where I'd like to have one fullscreen window on one display and a resized-down-by-two mirror of the fullscreen display in a window on the second display. I can do this easily with the standard pySDL2…
Mike Lawrence
  • 1,641
  • 5
  • 20
  • 40
0
votes
1 answer

PyOpenGL .obj file not displayed correctly

Why is my object file not displaying correctly... This is what it looks like: This is the code i have: #self.verts - vertices #self.norms - normals #self.faces - faces for i in range(len(self.verts)): …
user1176999
  • 440
  • 8
  • 20
0
votes
1 answer

PyQt4 OpenGL: GL core profile error

Good afternoon, I'm studying OpenGL - the "red book". I'm trying to make the first example (draw two triangles): # PyQT4 imports from PyQt4 import QtGui, QtCore, QtOpenGL from PyQt4.QtOpenGL import QGLWidget # PyOpenGL imports from OpenGL.GL import…
Eugene Kolesnikov
  • 643
  • 2
  • 6
  • 15
0
votes
1 answer

How should I conditionally render in OpenGL?

I'm having some trouble understanding how I should conditionally render shapes. For example, say I want to render a 3d object based upon the push of a button - how am I suppose to handle that? I haven't really been able to find example code or…
user3675085
  • 51
  • 1
  • 1
  • 3
0
votes
1 answer

PyOpenGL No array-type handler for type

I've just freshly installed python 2.7(.6) on Mac OS 10.6.8. I installed python via homebrew, as many of my needed modules as I could via pip, and the rest compiled from source. I'm making a game, with Pygame and PyOpenGL. The game ran fine on my…
bonzairob
  • 81
  • 1
  • 4
  • 10
0
votes
0 answers

What is wrong in this fragment shader?

I am writing a simple OpenGL app, that applies a 2D texture to a triangle strip. My fragment shader does not compile (I am using PyOpenGL): FRAGMENT_SHADER = shaders.compileShader("""#version 130 in vec4 color_v; layout(location = 0) out…
Raoul
  • 1,872
  • 3
  • 26
  • 48
0
votes
1 answer

python more fonts in glut (glutBitmapCharacter)

I'm using glutBitmapCharacter of pyOpenGL in Python, but the only fonts I can choose to use are helvetica and times_new_roman. Is it possible to add more fonts?
Joost Verbraeken
  • 883
  • 2
  • 15
  • 30
0
votes
1 answer

'GLXPlatform' object has no attribute 'WGL'

I'm a beginner in OpenGL/OpenCL. I'm trying to execute code from this example, but there is an error: Traceback (most recent call last): File "/home/anka-rybalko/workspace/bla/openGL.py", line 99, in initializeGL self.initialize_buffers() File…
prybalko
  • 115
  • 1
  • 7
0
votes
1 answer

Is it possible to use together pyggel and GLUT libraries

I'm new to PyopenGL and i'm currently working on a code originally based on the pyggel library, but now I'd like to add some features from GLUT (menu & text) and I'm not really sure how I should join both (if possible). In GLUT, running…
J. Born
  • 101
  • 8
0
votes
1 answer

Render to screen and to FBO give different result

I wrote a program to render a square with texture to screen and to a FBO. I believe the rendering result should be the same for both case, only the output destination is different. Surprisingly, it gives me completely different result. For the first…
Lingfeng Xiong
  • 1,131
  • 2
  • 9
  • 25