[PyOpenGL-Users] glDrawArrays and PyOpenGL 3.0.0a6 anything changed?
Brought to you by:
mcfletch
From: V. A. S. <so...@es...> - 2007-10-04 09:47:05
|
Hello, The following code was working fine on PyOpenGL 2.0.1.09: GL.glVertexPointerf(self.vertices) GL.glColorPointerf(self.vertexColors) GL.glEnableClientState(GL.GL_VERTEX_ARRAY) GL.glEnableClientState(GL.GL_COLOR_ARRAY) GL.glDrawArrays(GL.GL_POINTS, 0, xsize*ysize) but now it does not work under PyOpenGL 3.0.0.a6: WindowsError: exception: access violation reading 0x0BD20028 If instead of using glDrawArrays, I loop for all the vertices and colors, the program works (of course very slowly): GL.glBegin(GL.GL_POINTS) for i in range(xsize * ysize): GL.glColor4fv(self.vertexColors[i]) GL.glVertex(self.vertices[i]) GL.glEnd() (by the way I also had to change from glVertexf to glVertex in order to get the loop working). The shape of my arrays are (xsize*ysize, 3) for the vertices and (xsize*ysize, 4) for the colors. Do I have to arrange my data in other way now? I have tried to use glVertextPointer and glColorPointer but either it did not work or (most likely) I could not figure out the proper parameter to be passed. Any hint? Thanks, Armando |