[PyOpenGL-Users] Problems with glReadPixels
Brought to you by:
mcfletch
From: Dirk R. <di...@li...> - 2007-06-29 15:55:23
|
Hi everybody, we're trying to use glReadPixels with PyOpenGL, but we're running into exceptions: Traceback (most recent call last): File "/store/home/mukaissi/MetNetVis/MetNetVis/UI/graphdrawwidget.py", line 155, in mousePressEvent index=GL.glReadPixels(event.x,event.y,1,1,GL.GL_RGB,GL.GL_UNSIGNED_BYTE) File "/store/home/mukaissi/software/PyOpenGL-3.0.0a6/OpenGL/GL/images.py", line 279, in glReadPixels ctypes.c_void_p( arrayType.dataPointer(array)) ctypes.ArgumentError: argument 1: <type 'exceptions.TypeError'>: wrong type Adding a few prints to see the types of the involved variables they seem to be ok: array: [[[0 0 0]]] <type 'numpy.ndarray'> arrayType: <class 'OpenGL.arrays.arraydatatype.GLubyteArray'> <type '_ctypes.PointerType'> dataPointer: 20509152 <type 'long'> This is using 3.0.0a6 on an x86_64 (RHEL) system. Is anybody using glReadPixels successfully? What are we missing? Thanks Dirk |