[PyOpenGL-Users] VBO Problem
Brought to you by:
mcfletch
From: Ian M. <geo...@gm...> - 2009-03-17 00:46:16
|
Hi, I've been trying a long time to get VBOs working with PyOpenGL. The VBOs appear to be created correctly, but I don't see anything at all on the screen (I have other objects onscreen too not drawn with VBOs just to make sure). I'm creating the VBOs like so (vbo_formatted_vertices is a NumPy array of the vertices all lumped into one array (not separated into separate 3-item lists)): vertex_vbo = glGenBuffersARB(1) glBindBufferARB(GL_ARRAY_BUFFER_ARB,vertex_vbo) glBufferDataARB(GL_ARRAY_BUFFER_ARB,vbo_formatted_vertices,GL_STATIC_DRAW_ARB) I am trying to draw the VBOs like so (zero_array = [0]*len(self.vbo_formatted_vertices[i]): glEnableClientState(GL_VERTEX_ARRAY) glBindBufferARB(GL_ARRAY_BUFFER_ARB,vertex_vbo) glVertexPointer(3,GL_FLOAT,0,zero_array) glDrawArrays(GL_TRIANGLES,0,len(vbo_formatted_vertices)) glDisableClientState(GL_VERTEX_ARRAY) glBindBufferARB(GL_ARRAY_BUFFER_ARB,0) Again, the code appears to run fine; I just don't see anything. Ideas why? Thanks, Ian |