Quizás alguien me ilumine. Tengo este fragmento de código: import pygame from OpenGL.GL import glClear, GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_STENCIL_BUFFER_BIT from pygame.constants import DOUBLEBUF, OPENGL pygame.init() clock = pygame.time.Clock() pygame.display.set_mode((640,480), DOUBLEBUF|OPENGL) while 1: glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT) pygame.display.flip() clock.tick(50) Ejecutar esto causa un consumo de memoria lento pero molesto cuando lo compruebo con el administrador . . . Read more
El siguiente código debería dibujar un cubo cada vez que se llame: código de error: draw=False block_VBO=0 block_EBO=0 block_VAO=0 block_EBO_buffer_len=0 def print_blocks(sx:int,sy:int,sz:int): global draw,block_VAO,block_EBO,block_VBO,block_EBO_buffer_len if not draw: block_point_buffer=[] block_color_buffer=[] block_EBO_buffer=[] block_point_buffer+=[x-0.5,y+0.5,z-0.5,#V0 x+0.5,y+0.5,z-0.5,#V1 x+0.5,y-0.5,z-0.5,#V2 x-0.5,y-0.5,z-0.5,#V3 x-0.5,y+0.5,z+0.5,#V4 x+0.5,y+0.5,z+0.5,#V5 x+0.5,y-0.5,z+0.5,#V6 x-0.5,y-0.5,z+0.5]#V7 block_EBO_buffer+=[0,1,5,4, 3,2,6,7, 0,3,7,4, 1,2,6,5, 0,1,2,3, 4,5,6,7] block_VBO=glGenBuffers(1) glBindBuffer(GL_ARRAY_BUFFER,block_VBO) a=numpy.array(block_point_buffer,dtype='float32') glBufferData(GL_ARRAY_BUFFER,sys.getsizeof(a),a,GL_STATIC_DRAW) block_EBO=glGenBuffers(1) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER,block_EBO) . . . Read more
Creé una ventana en Qt Designer y agregué un widget de OpenGL como widget principal de visualización. En mi código principal, ahora quiero intercambiar este widget de OpenGL con un pyqtgraph.OpenGl.GlViewWidget, pero el comportamiento original se pierde cuando lo hago de esta manera: “`html <h1>Código generado por Qt Designer</h1> class . . . Read more
Quiero crear un sistema de guizmo en el proyecto de pyopengl en el que estoy trabajando. Para hacer eso, necesito una manera de saber qué objeto de la escena está el ratón encima, ¿hay alguna forma de averiguarlo? Si ayuda como ejemplo, este es el proyecto en el que estoy . . . Read more
Me resulta difícil lidiar con este problema. He pasado toda la noche en él y requiero ayuda. Quiero mostrar un triángulo simple con las PyOpenGL bindings, pero mi aplicación se bloquea y no se renderiza nada. Para el proyecto uso una ventana glfw – nada en particular se hace en . . . Read more