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

Are buffers shared between two GLSL programs?

In my app, I need to switch between two GLSL programs through glUseProgram(program). I am wondering if I write: glUseProgram(program1) buf1 = glGenBuffers(1) glUseProgram(program2) buf2 = glGenBuffers(1) Can buf1 and buf2 be the same value? i.e.…
floflo29
  • 2,261
  • 2
  • 22
  • 45
-1
votes
1 answer

Image of circle being shown as a square in OpenGL

Using pyGame and pyOpenGL, I have created a 2D surface, I used this 815x815 PNG created in Photoshop as a texture: Here is how I'm loading the image, using pygame, and converting it into a texture. pygame.init() display =…
Bretsky
  • 423
  • 8
  • 23
-1
votes
2 answers

Why can't I draw a texture in 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…
V_shr
  • 39
  • 5
-1
votes
1 answer

NameError: global name 'glGenVertexArrays' is not defined

I am using OpenGL version 3.0, when I try: vao = glGenVertexArrays(1) I get: NameError: global name 'glGenVertexArrays' is not defined Somebody knows why? Here is what I am importing: import OpenGL from OpenGL.GLU import * from OpenGL.GL import…
-1
votes
1 answer

OpenGL error when using Intel HD 4000

The code I am working on (Python+PyOpenGL) runs w/o problems on: GL Version: 4.2.12217 Compatibility Profile Context 12.104.0.0, GL Renderer: AMD Radeon HD 6300M Series, GL Vendor: ATI Technologies Inc. GL Version: 4.4.0, GL Renderer: NVS…
lskrinjar
  • 5,483
  • 7
  • 29
  • 54
-2
votes
1 answer

Why can't I see the mesh?

import pygame as pg import numpy as np import pyassimp import glm from OpenGL.GL import * vertex_shader = """ #version 330 core layout (location = 0) in vec3 aPos; uniform mat4 model; uniform mat4 projection; uniform mat4 view; void main(){ …
bin4ry
  • 3
  • 3
-2
votes
1 answer

pyopengl How to color concave polygons

pyopengl How to color concave polygons,graphics like this,When filling the color, I always fill the concave place flat. I hope I can fill the color according to the outline of the figure When filling the color, I always fill the concave place flat.…
吼嗒一
  • 19
  • 2
-2
votes
1 answer

integrating OpenGL with webcam in python language

how to integrate webcam texture with the OpenGL in python language . i didnt get any example on internet plzz answer
-2
votes
1 answer

Basics of PyQt5 and PyOpenGL

I'm trying to learn how to use PyQt5 and PyOpenGL to do a simple gui for display some shapes. I searched a lot but i didnt find any example/tutorial that show me the basics. I just want to draw simple shapes in the widget of this mainwindow. Here is…
-2
votes
1 answer

Can I use Numba to speed up operations with OpenGL functions?

I have a list of points that's constantly updating. I want to plot lines using those points with pyopengl. If the list becomes too big, my render function becomes slow. Can I use Numba to speed up the process? Or any other optimization tool such as…
-2
votes
2 answers

How to quickly refresh images on screen with Python/OS-X and improve upon opencv's imshow()

I'm working on a Python (2.7.13) program that reads images from the webcam (refreshed on a separate thread), does a perspective transform, and puts the live video in a window on the screen, using opencv (3.2.0-dev). I get very low FPS (13) updating…
Jon R
  • 13
  • 5
-2
votes
2 answers

Change color of figures with PyOpenGL

I have to do a basic program in Python using the library Opengl...when somebody press the key 'r', the figure change to red, when somebody pressed key 'g' change green and when somebody pressed 'b' change blue. I don't know why the color doesn't…
Carmoreno
  • 1,271
  • 17
  • 29
-2
votes
1 answer

Retained Mode to draw 2D texture image

I'm trying to use the "retained mode" to draw my 2D images (loaded as texztures inside pygame with an opengl context), and the way i found to do so is using VBO, but i can't find a opengl tutorial that uses VBO to draw anything but primitives. Is…
-3
votes
1 answer

What does this piece of code do and mean?

I recently came across this python code... array_type = (GL.GLfloat * len(vertexPositions)) final = array_type(*vertexPositions) but i don't understand what array_type(*vertesPositions) is what it means and what it does... can anyone explain it to…
Woundrite
  • 1
  • 3
-5
votes
1 answer

Implementing pyglet breaks my once working framebuffer OpenGL code

This question repeats my earlier one but my earlier one was a failure because I didn't copy some vital information correctly, so I have to redo it. I'm getting an error with a call to an OpenGL function. Maybe pyglet isn't initialising OpenGL…
Matthew Mitchell
  • 5,293
  • 14
  • 70
  • 122
1 2 3
62
63