[PyOpenGL-Users] Point VBO
Brought to you by:
mcfletch
From: Ian M. <geo...@gm...> - 2009-04-01 02:06:03
|
Hello, I have a VBO which should make a square grid: #Numeric is "import numpy as Numeric" class glLibCausticGrid: def __init__(self,size): self.size = size self.size_squared = size*size threedimensionalgrid = Numeric.dstack(Numeric.mgrid[0:size,0:size,0:1])/float(size-1) threedimensionalgrid = threedimensionalgrid.reshape(self.size_squared,3) self.vertex_vbo = vbo.VBO(threedimensionalgrid) def draw(self): glEnableClientState(GL_VERTEX_ARRAY) self.vertex_vbo.bind() glVertexPointerf(self.vertex_vbo) glDrawArrays(GL_POINTS,0,self.size_squared) glBindBuffer(GL_ARRAY_BUFFER,0) glDisableClientState(GL_VERTEX_ARRAY) def __del__(self): self.vertex_vbo.delete() When it is drawn, I get an incorrect result--the vertices are all over the place in semi-ordered, but incomprehensible patterns. I really need it to be a grid. Pointers? Thanks, Ian |