PyGLM
OpenGL Mathematics (GLM) library for Python
Tiny Documentation
Why PyGLM?
Installation
pip install pyglm
import glm
Using PyGLM
License requirements
COPYING or GLM_LICENSE file (or their contents) to your project.Differences to glm
glm::vec2 becomes glm.vec2.bytes or numpy.arrayresult = glm.vec2(1) * (2, 3)
packed_highp).float and double arguments, the higher precision (double) is used.glm.perspective becomes glm.perspectiveLH.GLM_FORCE_CTOR_INIT is defined)glm.sizeof(<type>)
glm.identity requires a matrix type as it's argument.glm.frexp(x, exp) returns a tuple (m, e), if the input arguments are numerical.UserWarning. You can silence this warning using glm.silence(1).glm.value_ptr(x) returns a ctypes pointer of the respective type.x is float, then a c_float pointer will be returned.make_vec2(ptr)) will take a ctypes pointer as their argumentglm.silence(ID) can be used to silence specific warnings.Unsupported functions
GLM_GTC_bitfield extension,glm::log2 from GLM_GTC_integer.glm::packUnorm and glm::packSnorm from GLM_GTC_packing.Build options
PyGLM.cpp there is a preprocessor option PyGLM_BUILD which is set to PyGLM_DEFAULT by default.PyGLM_DEFAULT will build all of PyGLM's functions and features.PyGLM_FAST removes PyGLM's iterable and GetBuffer checking, thus making it incompatible with tuples, numpy arrays and bytes objects while increasing overall performance.PyGLM_NO_FUNCTIONS removes all of the functions of glm and only builds the bare types.PyGLM_MINIMAL combines PyGLM_FAST and PyGLM_NO_FUNCTIONS.Example
>>> import glm >>> v = glm.vec3() >>> v.x = 7 >>> print(v.xxy) vec3( 7, 7, 0 ) >>> m = glm.mat4() >>> print(m) [ 1 | 0 | 0 | 0 ] [ 0 | 1 | 0 | 0 ] [ 0 | 0 | 1 | 0 ] [ 0 | 0 | 0 | 1 ] >>> v = glm.vec4(1, 2, 3, 4) >>> print(v + (8, 7, 6, 5)) vec4( 9, 9, 9, 9 )
Speed comparison to numpy
How PyGLM's performance roughly compares to NumPy's performance: instruction | np speed (%) | glm speed (%) import | 4.76 | 100.00 mat4() | 9.76 | 100.00 dot(vec3, vec3) | 28.92 | 100.00 transpose(mat4) | 25.64 | 100.00 vec4 * vec4 | 27.89 | 100.00 mat4 * vec4 | 17.68 | 100.00 mat4[0] | 49.99 | 100.00
Metadata
Release files for pyglm 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| PyGLM-1.1.2.tar.gz | 281.9 kB | Without provenance | Details for PyGLM-1.1.2.tar.gz |
Built distributions (wheels)
Total release size: 6.6 MB
Release files / PyGLM-1.1.2.tar.gz
| Download URL | PyGLM-1.1.2.tar.gz |
|---|---|
| Size | 281.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
087dec46e1f8113204ed6897ac1d7e57a8411bf1515084a2a7801b74bc2e6060
|
|
BLAKE2b-256 checksum How to use checksums |
548549ad607a64fc0f60696a00f57282f8ebaa3cb5c6ac0f2c3f1e773026be5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0
|
Release files / PyGLM-1.1.2-cp38-cp38-win_amd64.whl
| Download URL | PyGLM-1.1.2-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 861.1 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8e04e4374a19409102c782336317bdabc4137ffd64c85f31a1e8dde9923a99e6
|
|
BLAKE2b-256 checksum How to use checksums |
725accb33fe4f93e65093ddf2bc2781c49c6707173005df991411347bb88b088
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0
|
Release files / PyGLM-1.1.2-cp38-cp38-win32.whl
| Download URL | PyGLM-1.1.2-cp38-cp38-win32.whl |
|---|---|
| Size | 729.7 kB |
| Tags | CPython 3.8 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
a6308a2a5566e93fd76479e1fe3633d2aa0ae159bc86fa49e8604c9d8db224f9
|
|
BLAKE2b-256 checksum How to use checksums |
3ceda4bdfd9e3368f027eb1795cad587b10c87cf5e11aff3e55593f887644a6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0
|
Release files / PyGLM-1.1.2-cp37-cp37m-win_amd64.whl
| Download URL | PyGLM-1.1.2-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 855.8 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
7277c7fbe24af0771c5d636f995d6518c170b3c1f67b311a79be409d8629b90e
|
|
BLAKE2b-256 checksum How to use checksums |
870da0ae1dd03a9f5d2c994fa3ed18d226082b6b68a9e49078db6c0b700adb25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0
|
Release files / PyGLM-1.1.2-cp37-cp37m-win32.whl
| Download URL | PyGLM-1.1.2-cp37-cp37m-win32.whl |
|---|---|
| Size | 727.5 kB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
f542951c62c5f039c63fea88b16aaae24301587b08517fe3fd346185d3530d7c
|
|
BLAKE2b-256 checksum How to use checksums |
cb9080232bf842df38339fa9415191c1c0d7d7be34060588f71a9ede8e5bc49f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0
|
Release files / PyGLM-1.1.2-cp36-cp36m-win_amd64.whl
| Download URL | PyGLM-1.1.2-cp36-cp36m-win_amd64.whl |
|---|---|
| Size | 855.8 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
693388290ec561adec29035fcf40348a2ef30e865d4b10f15e799bfc31daa5ba
|
|
BLAKE2b-256 checksum How to use checksums |
ec0569b0370aa9d7cf17918ebe190d71a598d66ec1c763191d2a4381cb8a8f4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0
|
Release files / PyGLM-1.1.2-cp36-cp36m-win32.whl
| Download URL | PyGLM-1.1.2-cp36-cp36m-win32.whl |
|---|---|
| Size | 727.5 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
99ec702fd3ff180e96bf7e5380603f230908cc529c0069bffb88de91d9800cda
|
|
BLAKE2b-256 checksum How to use checksums |
7f15a78d474d2f97cbf6908c163f9577b081195d995847b1aadcd8483e06caca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0
|
Release files / PyGLM-1.1.2-cp35-cp35m-win_amd64.whl
| Download URL | PyGLM-1.1.2-cp35-cp35m-win_amd64.whl |
|---|---|
| Size | 868.1 kB |
| Tags | CPython 3.5 CPython 3.5 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
112349d89409d44dd1640505a7f2f6ec5dac0328674f382eebbe3f0fa9dadb27
|
|
BLAKE2b-256 checksum How to use checksums |
f0c1acea8f39fabc0ea4ef5a3bf25090e11699eb8aca8fc172cc366f1e6e0987
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0
|
Release files / PyGLM-1.1.2-cp35-cp35m-win32.whl
| Download URL | PyGLM-1.1.2-cp35-cp35m-win32.whl |
|---|---|
| Size | 716.1 kB |
| Tags | CPython 3.5 CPython 3.5 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
da4b34ee4976f2440685e811486f3be90b7e472b945a702f9e2f36065b403ee9
|
|
BLAKE2b-256 checksum How to use checksums |
91a366f0fc49194c8932e6a1371859144f50067b498a45828e780d1a9dfb5187
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.8.0
|
Security for pyglm 1.1.2
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.