From 815746895dd2b7e54d8733f133a9b5be092ea89e Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Wed, 13 Feb 2013 17:11:47 -0500 Subject: [PATCH] Fixed GLSurfacePlot bug --- examples/GLSurfacePlot.py | 2 +- pyqtgraph/opengl/items/GLSurfacePlotItem.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/GLSurfacePlot.py b/examples/GLSurfacePlot.py index c901d51e..d2151c46 100644 --- a/examples/GLSurfacePlot.py +++ b/examples/GLSurfacePlot.py @@ -62,7 +62,7 @@ w.addItem(p3) ## Animated example ## compute surface vertex data -cols = 100 +cols = 90 rows = 100 x = np.linspace(-8, 8, cols+1).reshape(cols+1,1) y = np.linspace(-8, 8, rows+1).reshape(1,rows+1) diff --git a/pyqtgraph/opengl/items/GLSurfacePlotItem.py b/pyqtgraph/opengl/items/GLSurfacePlotItem.py index 69080fad..46c54fc2 100644 --- a/pyqtgraph/opengl/items/GLSurfacePlotItem.py +++ b/pyqtgraph/opengl/items/GLSurfacePlotItem.py @@ -127,8 +127,8 @@ class GLSurfacePlotItem(GLMeshItem): def generateFaces(self): - cols = self._z.shape[0]-1 - rows = self._z.shape[1]-1 + cols = self._z.shape[1]-1 + rows = self._z.shape[0]-1 faces = np.empty((cols*rows*2, 3), dtype=np.uint) rowtemplate1 = np.arange(cols).reshape(cols, 1) + np.array([[0, 1, cols+1]]) rowtemplate2 = np.arange(cols).reshape(cols, 1) + np.array([[cols+1, 1, cols+2]])