pyopengl

PyOpenGL OpenGL Version on MacOs

假如想象 提交于 2020-07-19 04:41:30
问题 I've been told to switch legacy profile to core profile from other stackoverflow posts but I can't seem to find a way to do that. So I'm positing a more updated error post to help me figure out a way. CODE: import glfw, numpy from OpenGL.GL import * import OpenGL.GL.shaders def main(): if not glfw.init(): return window = glfw.create_window(800,600,"My OpenGL Window", None, None) if not window: glfw.terminate() return glfw.make_context_current(window) triangle = [-0.5, -0.5, 0.0, 0.5, -0.5, 0

How to get I the correct texture using indexing in opengl

倖福魔咒の 提交于 2020-06-29 05:03:14
问题 I want to impement a pyramid which has different texture in each side. The pyramid with the textures is correct without using an index data array. When i use the indexdata the textures get mixed with each other. Do i have to correct the AttribPointer? (My texture is a collage image of 5 different images) *I want to keep the indexData array Here is a part of the code from OpenGL.GLUT import * from OpenGL.GLU import * from OpenGL.GL import * import numpy as np from framework import * from PIL

glsl pyOpenGL array passing

流过昼夜 提交于 2020-05-15 07:15:30
问题 I'm currently playing around with glsl. For that purpose i need to pass an array from the opengl code to the gsls, which then in return calculates a new color out of the array. But somehow this doesn't work for me. Instead of getting the whole array I'm always stuck with only the first entry. Could you help me by saying what I'm doing wrong? import numpy as np \\... array = np.array([1.2,2.5,3.8,4.3,5.6, #....]) location = glGetUniformLocation(program,"arrayInShader") glUniform1fv(location,1