Hi,
I have recently noticed strange behavior of wxNviz, for example vector
layer is always visible even if I use negative z coordinate and it
should be hidden below a surface. Probably, it is connected to newer
wxPython version I started to use recently (2.8.12, so it's actually
not new at all). According to the discussion [1], I tried these lines:
Index: nviz/mapwindow.py
--- nviz/mapwindow.py (revision 55276)
+++ nviz/mapwindow.py (working copy)
@@ -72,8 +72,10 @@
def __init__(self, parent, id = wx.ID_ANY,
Map = None, tree = None, lmgr = None):
self.parent = parent # MapFrame
- glcanvas.GLCanvas.__init__(self, parent, id)
+ from wx.glcanvas import WX_GL_DEPTH_SIZE
+ attribs=[WX_GL_DEPTH_SIZE,16,0]
+ glcanvas.GLCanvas.__init__(self, parent, id, attribList=attribs)
MapWindow.__init__(self, parent, id,
Map, tree, lmgr)
which solved the problem. So, I would like to know if someone noticed
this problem on other platforms than Linux. It's not clear to me if
these lines are harmless or not for other platforms and if the number
of the WX_GL_DEPTH_SIZE (= 16) can be used safely (probably different
number works on different computers, see also [2]).
Thanks for any info,
Anna
[1] http://wxpython-users.1045709.n5.nabble.com/OpenGL-depth-buffer-deosn-t-seem-to-work-in-wx-glcanvas-td5714984.html#a5714991
[2] http://stackoverflow.com/questions/14715739/how-can-i-determine-the-max-allowable-wx-gl-depth-size-for-a-wx-glcanvas