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

PyOpenGL GLSL version support

I've installed PyOpenGL for my Ubuntu PC, & I used it with Pygame withot any problems, but now I've experimented a bit with Sharders. I used the sharder loading code from the Pygame CookBook, with the simplest possible vertex sharders for #version…
Uncle Dino
  • 812
  • 1
  • 7
  • 23
0
votes
1 answer

How to render superimposed planar objects in OpenGL?

I am trying to render geographical data obtained at different time with different sensors. Currently, I manage (through OpenGL and QOpenGL widget) to render a single image (i.e. all vertices have a z=0 coordinates). However, I am wondering how to…
floflo29
  • 2,261
  • 2
  • 22
  • 45
0
votes
0 answers

Buffering Vertex Data in PyOpenGL

I have been using (modern: OpenGL 3.3) OpenGL in the past with C++ bindings. I have just started learning to use the python bindings. I have a program that runs but I am unable to get it to draw anything. I am using 64 bit python 3.4 on a Windows 10…
Francis
  • 1,151
  • 1
  • 13
  • 29
0
votes
1 answer

Paint over a QGLWidget fail

I am trying to paint over a QGLWidget by means of a QPainter as explained in various tutorials. In my paintGL() function, I have two cases. Indeed, if there is nothing to draw in OpenGL then I only use the QPainter to draw 2 lines (this part does…
floflo29
  • 2,261
  • 2
  • 22
  • 45
0
votes
3 answers

How to fix 3rd party libraries that omit the required C runtime lib?

I'm writing an NSIS installer for a project that requires the PyOpenGL package, however installation of this package fails because my system doesn't contain mscvr71.dll (VS C runtime lib). According to KB326922, this library should have been…
Dana the Sane
  • 14,762
  • 8
  • 58
  • 80
0
votes
1 answer

PyQt QGLWidget won't preserve aspect ratio

I have a problem layouting a PyQt window. I'm using a grid layout with one big QGLWidget and many smaller control components below it. When subclassing the QGLWidget I'm using the following code: class GLWidget(QtOpenGL.QGLWidget): def…
Cookie
  • 678
  • 1
  • 11
  • 22
0
votes
1 answer

Terrain Texture in PyOpenGL not Rendered

I need help for this code. I want to render a grass texture using file "grass.bmp" which I already have. This is the code for load image. texsurfGrass = pygame.image.load('grass.bmp') imageGrass = pygame.image.tostring(texsurfGrass, "RGB", 1) texID…
Leo
  • 3
  • 1
0
votes
0 answers

Import a cropped image in PyGame and PyOpengl

How do you crop an image and save them as 2 OpenGL textures in PyGame? This is my code for loading a full image: def loadImage(image): img = pygame.image.load(image)) textureData = pygame.image.tostring(img, "RGBA", 1) texture =…
Matt Majic
  • 381
  • 9
  • 18
0
votes
1 answer

OpenGL Luminance internal data type

I'm creating a 2D texture and am getting confused on what data type my texture is actually being stored at. My input is a 2D 32-bit float array that is normalized to 0-1 for now. I'm creating a texture with a call resembling…
djhoese
  • 3,567
  • 1
  • 27
  • 45
0
votes
1 answer

DrawElements crashes Qt App

I've setup a qt widget that serves as an opengl viewer. My goal is to use it as a texture viewer and as a model viewer as well. That's why i've created two different programs, with different shaders attached to them to fit my needs. I'm storing all…
Greg K.
  • 686
  • 1
  • 5
  • 18
0
votes
0 answers

PyGame Left/Right, Up/Down Rotation

I need help for PyOpenGL in pygame. I want to be able to rotate the view so it is global, I believe the term is. I want to be able to rotate left and right around the y (up) axis, and up and down toward the y axis. How would I go about doing…
Jesus Cuevas
  • 57
  • 1
  • 6
0
votes
2 answers

Why do I get "Texture unit 0 is accessed both as sampler2D and samplerCube" for two different samplers?

I have this bit of OpenGL/Python code: import sys from OpenGL.GL import * from OpenGL.GL import shaders from OpenGL.GLU import * from OpenGL.GLUT import * glutInit(sys.argv) glutInitDisplayMode(GLUT_RGBA) glutInitWindowSize(640, 480) window =…
Vegard
  • 2,081
  • 1
  • 17
  • 26
0
votes
1 answer

Getting a 3d mouse position in python

I would like to develop a python application to import an obj file and then allow the user to interact with it, moving the loaded objects (including the roll and span movements). Furthermore, when the user clicks on an area of the model, the…
Gekk0r
  • 13
  • 2
0
votes
1 answer

Draw extruded 3d text with pyopengl?

What is the best way to draw 3d text with pyopengl, preferably with modern opengl ? There seem to be quite a few examples, but mostly in old-style opengl and not for python
Stuart Axon
  • 1,844
  • 1
  • 26
  • 44
0
votes
4 answers

Piecing together 2D images through PyOpenGL

I am trying to cobble together a scene that basically consists of: A 2D image of the earth (think NASA satellite photography) that has been rotated into a view similar to this and, Cylindrical tubes that I want place at specific lat/lon…
Scott
  • 590
  • 4
  • 13