glut

Transparent textures being rendered as black in OpenGL

Transparent textures being rendered as black in OpenGL Question: I have a texture with transparent parts, but instead of being rendered transparent they’re black. To test if the RGBA values get passed on correctly to the shader, I made everything render in greyscale. And as I thought the alpha values weren’t getting passed on correctly. …

Total answers: 1

Why do objects in my window sometimes disappear and reappear?

Why do objects in my window sometimes disappear and reappear? Question: The objects in my window sometimes disappear and reappear. This mainly happens when resizing the window. I suppose this is because my two methods conflict with each other with the glutMainLoopEvent() function. I create the window like this: def create_display(self, window_name): glutInit() glutInitDisplayMode(GLUT_RGBA) # …

Total answers: 1

My texture is being displayed as completely black in pyOpenGL

My texture is being displayed as completely black in pyOpenGL Question: I was trying to display a texture in pyOpenGL with the following methods. Instead of the texture being rendered correctly, the entire object was black. The texture is being loaded with PIL in an RGBA format. I try to load in the texture using …

Total answers: 1

glDrawElements method not drawing with indices and vertices

glDrawElements method not drawing with indices and vertices Question: My desired output of my program would be a simple quad being drawn onto the screen, instead nothing is being drawn on my screen. The relevant methods of my program are below. What is wrong in my code causing this issue? I’m trying to draw a …

Total answers: 2

Does glBufferData need a Buffer object as the 'data' parameter?

Is the last parameter of glVertexAttribPointer a '0' or 'None'? Question: I am trying to setup a simple 3D Engine in pyOpenGL. My current goal was to achieve a 2D rectangle being displayed to the screen, which isn’t working at all. (nothing is being rendered to the screen, no exception is being thrown by the …

Total answers: 1

glGenVertexArrays function doesn't work in every Python script

glGenVertexArrays function doesn't work in every Python script Question: I want to create a pyOpenGL program to display quads. When creating a VAO an exception is being thrown. The glGenVertexArrays function throws this excpetion in my loader.py script: OpenGL.error.NullFunctionError: Attempt to call an undefined function glGenVertexArrays I guess it has something to do with initialization. …

Total answers: 1

how to use glutKeyboardFunc in python?

how to use glutKeyboardFunc in python? Question: i just wanna use my keyboard for transform my logo, but doesnt work, did i forget something? what should i do to get glutKeyboardFunc work? please help me w,h= 600,600 xScale = 1 yScale = 1 def logo(): glScaled(xScale,yScale,0) glBegin(GL_POLYGON) glColor3ub(255,0,0) glVertex2f(0, 0) glVertex2f(120, 200) glVertex2f(0, 400) glVertex2f(-120, …

Total answers: 1

Attempt to call an undefined function glutInit

Attempt to call an undefined function glutInit Question: I need a glut window in python. I have the following exception using Python 3.5 and PyOpenGL.GLUT Traceback (most recent call last): File “D:…Test.py”, line 47, in <module> if __name__ == ‘__main__’: main() File “D:…Test.py”, line 9, in main glutInit(sys.argv) File “C:…OpenGLGLUTspecial.py”, line 333, in glutInit _base_glutInit( …

Total answers: 3

Print text with glut and python

Print text with glut and python Question: I’ve written this function for printing some text with python and python opengl def glut_print( x, y, font, text, r, g , b , a): blending = False if glIsEnabled(GL_BLEND) : blending = True #glEnable(GL_BLEND) glColor3f(1,1,1) glRasterPos2f(x,y) for ch in text : glutBitmapCharacter( font , ctypes.c_int( ord(ch) ) …

Total answers: 4