Some helper class
Project description
glsurface
glsurface is a python class to show 2d/3d data with wxPython and PyOpenGL.
Installation
$ pip install glsurface
Usage
- Create a class from
TrackingSurfaceclass Surface(TrackingSurface): def __init__(self, *args, **kwargs): TrackingSurface.__init__(self, *args, **kwargs) ...
- Create an instance, and set data (optional)
class SurfacePanel(wx.Panel): def __init__(self, parent): wx.Panel.__init__(self, parent, -1) ... self.x = np.linspace(0, 2 * np.pi, 30).reshape((1, 30)) z = np.cos(self.x).T * np.sin(self.x) self.canvas = Surface(self, {'z': z}) ...
- Update the data
- Add new frame data to the current frame buffer
self.canvas.NewFrameArrive(z, silent=False)
- Or reset the frame buffer with new data
self.canvas.SetFrames(points, reset_buf_len=True, silent=False)
- Add new frame data to the current frame buffer
Check gltest.py for details.
Known issues
-
On Linux, it may show the following error.
OpenGL.error.Error: Attempt to retrieve context when no valid context
In this case, try different OpenGL platform, e.g.,
$ export PYOPENGL_PLATFORM='egl'
All supported platforms can be found here
/path/to/python/site-packages/OpenGL/__init__.py -
For EGL Surface, you may need to call
CreateSurface, as mentioned here
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file glsurface-0.1.1.tar.gz.
File metadata
- Download URL: glsurface-0.1.1.tar.gz
- Upload date:
- Size: 20.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56f080bd0045e8435e3c9e84a5494084d3d9021d39d5b7355cae1f0092b589e6
|
|
| MD5 |
2d4f521530ec246ebd7dea51c45a93c0
|
|
| BLAKE2b-256 |
a96ddabe664fd7d9ccda7a6274313c72236739e05dd4c917c2d186d0c4065db0
|
File details
Details for the file glsurface-0.1.1-py3-none-any.whl.
File metadata
- Download URL: glsurface-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8268c22a4c59e118572849a163e15deb9d79a725ef2f5568783926bc54d7a84
|
|
| MD5 |
751b9e9df311806a0e9f0030f3e306bc
|
|
| BLAKE2b-256 |
320a08f3ec45b841ec878e1f27939538e481708bacc7e8bac12ab73bea561f90
|