WxGL
WxGL是一个基于PyOpenGL的跨平台三维数据快速可视化工具包,提供类似Matplotlib风格的应用方式。WxGL也可以集成到wxPython或PyQt6中实现更多的功能和控制。
安装
pip install wxgl
快速体验
下面这几行代码,绘制了一个半径为1的地球,并以20°/s的角速度绕地轴自转。配合太阳光照效果和模型动画,可以清晰地看到晨昏分界线的变化。这段代码在example路径下有更详细的说明。
import numpy as np
import wxgl
r = 1 # 地球半径
gv, gu = np.mgrid[np.pi/2:-np.pi/2:91j, 0:2*np.pi:361j] # 纬度和经度网格
xs = r * np.cos(gv)*np.cos(gu)
ys = r * np.cos(gv)*np.sin(gu)
zs = r * np.sin(gv)
light = wxgl.SunLight(direction=(-1,1,0), ambient=(0.1,0.1,0.1)) # 太阳光照向左前方,暗环境光
tf = lambda t : ((0, 0, 1, (0.02*t)%360), ) # 以20°/s的角速度绕y逆时针轴旋转
app = wxgl.App(haxis='z') # 以z轴为高度轴
app.title('自转的地球')
app.mesh(xs, ys, zs, texture='res/earth.jpg', light=light, transform=tf)
app.show()
Metadata
Release files for wxgl 0.9.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wxgl-0.9.14-py3-none-any.whl | Python 3 | none | any | Details for wxgl-0.9.14-py3-none-any.whl |
Release files / wxgl-0.9.14-py3-none-any.whl
| Download URL | wxgl-0.9.14-py3-none-any.whl |
|---|---|
| Size | 136.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a7820829b3f2fa1df2398beb7797b90d94616896e84cb94aae19c48426bb49b6
|
|
BLAKE2b-256 checksum How to use checksums |
3b22d4c50ba3403af002bba724a11ab0744c8ea951d52b469d4806a55207ea09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.2
|
Security for wxgl 0.9.14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.