def __fillVerticesBufferObject(self): if self.vertices is None: self.vertices = Object3DCTools.get3DGridFromXYZ( self._x, self._y, self._z) self.indices = numpy.arange(self.nVertices) self._verticesBufferObject = buffers.VertexBuffer( self.vertices, GL.GL_STATIC_DRAW) self.vertices = None
def __fillVerticesBufferObject(self): if self.vertices is None: self.vertices = Object3DCTools.get3DGridFromXYZ(self._x, self._y, self._z) self.indices = numpy.arange(self.nVertices) self._verticesBufferObject = buffers.VertexBuffer(self.vertices, GL.GL_STATIC_DRAW) self.vertices = None
def buildPointListOLD(self): if self.vertices is None: self.vertices = Object3DCTools.get3DGridFromXYZ( self._x, self._y, self._z) GL.glVertexPointerf(self.vertices) GL.glColorPointerub(self.vertexColors) GL.glEnableClientState(GL.GL_VERTEX_ARRAY) GL.glEnableClientState(GL.GL_COLOR_ARRAY) GL.glDrawArrays(GL.GL_POINTS, 0, self.nVertices)
def buildPointListOLD(self): if self.vertices is None: self.vertices = Object3DCTools.get3DGridFromXYZ(self._x, self._y, self._z) GL.glVertexPointerf(self.vertices) GL.glColorPointerub(self.vertexColors) GL.glEnableClientState(GL.GL_VERTEX_ARRAY) GL.glEnableClientState(GL.GL_COLOR_ARRAY) GL.glDrawArrays(GL.GL_POINTS, 0, self.nVertices)
object3D = Object3DMesh(os.path.basename(f)) else: data = numpy.arange(200.).astype(numpy.float32) data.shape = [40, 5] object3D = Object3DMesh('builtin') #several options: regular grid, irregular grid if len(sys.argv) > 1: #print "IMPOSSING A 1000 OFFSET" #offset = 1000.0 offset = 0 #irregular grid xSize, ySize = data.shape[0:2] zSize = 1 xyz = Object3DCTools.get3DGridFromXYZ( numpy.arange(xSize).astype(numpy.float32) - offset, numpy.arange(xSize).astype(numpy.float32) + offset, numpy.arange(1) + 1) a = xyz[:, 0] * 1 xyz[:, 0] = xyz[:, 1] * 1 xyz[:, 1] = a[:] #print xyz[0:3,:] #print xyz.shape #print Object3DCTools.getVertexArrayMeshAxes(xyz) #sys.exit(0) data.shape = 1, xSize * ySize xyz[:, 2] = data[:] object3D.setData(data, xyz=xyz) elif 0: #flat object3D.setData(data, z=4) else:
object3D = Object3DMesh(os.path.basename(f)) else: data = numpy.arange(200.).astype(numpy.float32) data.shape = [40, 5] object3D = Object3DMesh('builtin') #several options: regular grid, irregular grid if len(sys.argv) > 1: #print "IMPOSSING A 1000 OFFSET" #offset = 1000.0 offset = 0 #irregular grid xSize, ySize = data.shape[0:2] zSize = 1 xyz = Object3DCTools.get3DGridFromXYZ(numpy.arange(xSize).astype(numpy.float32)-offset, numpy.arange(xSize).astype(numpy.float32)+offset, numpy.arange(1)+1) a = xyz[:,0] * 1 xyz[:,0] = xyz[:,1] * 1 xyz[:,1] = a[:] #print xyz[0:3,:] #print xyz.shape #print Object3DCTools.getVertexArrayMeshAxes(xyz) #sys.exit(0) data.shape = 1, xSize * ySize xyz[:,2] = data[:] object3D.setData(data, xyz=xyz) elif 0: #flat object3D.setData(data, z=4) else: