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

How to draw an outline for a shape in Opengl ( version 420 core profile )

I am drawing a rectangle using VBO, EBO with GL_TRIANGLE_STRIP drawing method. Now I would like to draw an outline for it but I don't know how. As I understand, I can use the same set of vertices and create an new set of indices for a LINE_LOOP. Do…
ryanvolap
  • 77
  • 1
  • 8
0
votes
1 answer

Overlay one 2D image onto another? PyOpenGL?

I am currently using PyOpenGL with PyGame to write code for a top-down 2D side scroller. The code shown below will generate a 2D image in a window. The image that is added is the background. I would now like to add sprites to the background using…
0
votes
1 answer

Issue drawing lines with OpenGL

Given this snippet: import textwrap import math import numpy as np from ctypes import * from OpenGL.GL import * from OpenGL.GL.ARB.multitexture import * from OpenGL.GL.ARB.debug_output import * from OpenGL.GLU import * from OpenGL.GLUT import…
BPL
  • 9,632
  • 9
  • 59
  • 117
0
votes
1 answer

getting a black screen when using glDrawElements

import textwrap import numpy as np from ctypes import * from OpenGL.GL import * from OpenGL.GL.ARB.multitexture import * from OpenGL.GLU import * from OpenGL.GLUT import * class TestOpenglManager(): # -------- Magic functions -------- …
BPL
  • 9,632
  • 9
  • 59
  • 117
0
votes
1 answer

PyOpenGL numpy texture appears as solid color

I'm trying to set numpy arrays as OpenGl textures in pygame. The problem is that only the first pixel is taken as texture data and instead of a random pattern (for example) I only get a random color every time. import pygame from pygame.locals…
Gergely H
  • 1
  • 1
0
votes
1 answer

Attempting to update 500+ vertex positions in OpenGL causes a read access violation?

I am attempting to plot a large number of vertices (similar to a point cloud). At the same time I am also trying to learn how to use VBOs and pass Numpy arrays in to the GLSL program and animate the vertex positions. I think I have made some…
Logic1
  • 1,806
  • 3
  • 26
  • 43
0
votes
1 answer

glGenVertexArrays error on openGL3+

my professor just gave us a simple code that draws a triangle and it worked fine on the university lab. However at my personal computer I'm running into some weird error that I can't seem to find the solution on line. Up until now all openGL code…
Alexandre Krabbe
  • 727
  • 1
  • 13
  • 33
0
votes
1 answer

glBindTexture - returns argument error

I am working on augmented reality project. So the user should use the Webcam, and to see the captured video with a cube drawn on that frame. And this is where I get stuck , when I try to use glBindTexture(GL_TEXTURE_2D,texture_background) method, I…
Stefan
  • 3
  • 1
  • 2
0
votes
1 answer

pyopengl - finding the edges of a shape during rotation

The idea behind this is to create a detection area for a security camera. Currently, I know how to find and use the modelview matrix data as shown below in the function "matrixTransformation". The value for the matrix should then be calculated for…
howardcrick
  • 27
  • 2
  • 7
0
votes
1 answer

pyopengl - creating a cylinder without using gluCylinder function

Using pyopengl, I am trying to create a cylinder. The top of the cylinder is not circular whilst the bottom is as shown in the image linked below. I would like to know how to fix this, if its the way I have coded it or simply the way I have done it…
howardcrick
  • 27
  • 2
  • 7
0
votes
1 answer

Python opengl cant get modelview matrix

I want to make a 3D Planet Simulation using python,pyopengl and pygame. All works fine but now I want to determine the viewers position so that he can add new planets there. I already found that post : Using glGetFloatv to retrieve the modelview…
Luatic
  • 8,513
  • 2
  • 13
  • 34
0
votes
1 answer

OpenGL output distorted (Possibly not offset to center?)

I am trying to output a square, and am getting a rather distorted rhombus. Like so, And though I can tell that this is in fact the cube I had intended, the cube is strangely distorted. In my own workings to create a simple 3D projection program, I…
user5446829
0
votes
0 answers

How to operate the "camera" 's position and rotation in openGL without gluLookAt

I do apologize, as it seems this sort of question has been answered in degree in other posts, but I haven't yet found the sort of answer I need. My intent is, as many other users of openGL, to create a simple 3D environment, and despite my usage of…
user5446829
0
votes
1 answer

Type error for params of sdl_CreateWindow using PySdl2

The following code fragment: self.width = 640 self.height = 400 self.window = sdl2.SDL_CreateWindow ( 'OpenGL test', sdl2.SDL_WINDOWPOS_UNDEFINED, sdl2.SDL_WINDOWPOS_UNDEFINED, self.width, self.height, sdl2.SDL_WINDOW_OPENGL…
Jacques de Hooge
  • 6,750
  • 2
  • 28
  • 45
0
votes
1 answer

Inconsistent skybox rendering using different textures in Pygame + PyOpenGL

Motivated by my incomplete answer to this question, I am implementing a simple skybox in PyOpenGL in accordance with this tutorial, making minor tweaks as needed for OpenGL 2.1/GLSL 120 and python2.7-isms. For the most part, it works successfully,…
CodeSurgeon
  • 2,435
  • 2
  • 15
  • 36