Skip to main content

OpenGL Mathematics library for Python

Project description

GLSL + Optional features + Python = PyGLM
A mathematics library for graphics programming written in C.

Work in progress.

PyGLM is based on GLM by G-Truc offering a lot of the original features.
PyGLM is missing some features, either because they couldn't be implemented properly
or were deemed to be of too low priority (like glm::detail::tvec1).
If you encounter any issues or want to request a feature, please create an issue on the issue tracker.

Tiny Documentation

Why PyGLM?

Besides the obvious - being compatible with GLM - PyGLM offers a variety of features for vector and matrix manipulation.
It has a lot of possible use cases, including 3D-Graphics (OpenGL, DirectX, ...), Physics and more.

At the same time, it has great performance, being between 2x and 10x as fast as numpy!
(depending on the individual function)

Installation

PyGLM supports Windows, Linux, MacOS and other operating systems with either x86 (32-bit) or x64 (64-bit) architecture,
running Python 2 or 3

It can be installed from the PyPI using pip:
pip install pyglm
And finally imported and used:
import glm

Using PyGLM

PyGLM's syntax is very similar to the original GLM's syntax.
There is no need to import anything but glm, as it already contains the entire package.
Instead of using double colons (::) for namespaces, periods (.) are used, so
glm::detail::tvec2
becomes
glm.detail.tvec2
You can also use the base namespace glm.
glm.tvec2

There is no way to set preprocessor definitions (macros).
If - for example - you need to use the left handed coordinate system, you have to use *LH, so
glm.perspective
becomes
glm.perspectiveLH

There is currently no documentation for PyGLM.
Please refer to the source (in Python: *.__doc__) and GLM manuals, references and tutorials.

Example

>>> import glm
>>> v = glm.vec3()
>>> v.x = 7
>>> print(v.xxx)
tvec3(            7,            7,            7 )

>>> m = glm.mat4()
>>> print(m)
[            0 |            0 |            0 |            0 ]
[            0 |            0 |            0 |            0 ]
[            0 |            0 |            0 |            0 ]
[            0 |            0 |            0 |            0 ]

>>> v = glm.vec4(1, 2, 3, 4)
>>> print(v + (8, 7, 6, 5))
tvec4(            9,            9,            9,            9 )

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

PyGLM-0.4.3b1.tar.gz (111.9 kB view details)

Uploaded Source

Built Distributions

PyGLM-0.4.3b1-cp36-cp36m-win_amd64.whl (204.0 kB view details)

Uploaded CPython 3.6m Windows x86-64

PyGLM-0.4.3b1-cp36-cp36m-win32.whl (178.8 kB view details)

Uploaded CPython 3.6m Windows x86

PyGLM-0.4.3b1-cp35-cp35m-win_amd64.whl (204.0 kB view details)

Uploaded CPython 3.5m Windows x86-64

PyGLM-0.4.3b1-cp35-cp35m-win32.whl (178.8 kB view details)

Uploaded CPython 3.5m Windows x86

PyGLM-0.4.3b1-cp34-cp34m-win_amd64.whl (194.7 kB view details)

Uploaded CPython 3.4m Windows x86-64

PyGLM-0.4.3b1-cp34-cp34m-win32.whl (189.1 kB view details)

Uploaded CPython 3.4m Windows x86

PyGLM-0.4.3b1-cp33-none-win_amd64.whl (194.7 kB view details)

Uploaded CPython 3.3 Windows x86-64

PyGLM-0.4.3b1-cp33-none-win32.whl (188.8 kB view details)

Uploaded CPython 3.3 Windows x86

PyGLM-0.4.3b1-cp27-cp27m-win32.whl (149.0 kB view details)

Uploaded CPython 2.7m Windows x86

File details

Details for the file PyGLM-0.4.3b1.tar.gz.

File metadata

  • Download URL: PyGLM-0.4.3b1.tar.gz
  • Upload date:
  • Size: 111.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyGLM-0.4.3b1.tar.gz
Algorithm Hash digest
SHA256 9f9b79cea7a61677954c0b27016e2877aced2b85aaff29cdfdc96a1bd6d51d2d
MD5 47e2c0b90be8a3b47288fcf7f1c010b9
BLAKE2b-256 5f9a22a787a45e22a4ae8aedb60eaebee58a44b0354107d1ee35884a1602f0f5

See more details on using hashes here.

Provenance

File details

Details for the file PyGLM-0.4.3b1-cp36-cp36m-win_amd64.whl.

File metadata

File hashes

Hashes for PyGLM-0.4.3b1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 ae0e00c3c8bbd14a8e4ab54121e5c731675b85545662d49d4647349f6bf039a4
MD5 ddf4d5fb111062f8090847cc904e4d3e
BLAKE2b-256 89396c2b429525e5a06ec33c271bb5693afd02f5516511e16ff9083848a96003

See more details on using hashes here.

Provenance

File details

Details for the file PyGLM-0.4.3b1-cp36-cp36m-win32.whl.

File metadata

File hashes

Hashes for PyGLM-0.4.3b1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 620a3308e54c5e0eea71c9fc52c2078b1419af6eb7b367ef3e4eab9dcf5ab3cd
MD5 d74eccb0c0b86955f7a12b235a461d7e
BLAKE2b-256 42f6e4603962c84ae6300a3918ad9feef90d129f454d7ea438d7aff288e1529a

See more details on using hashes here.

Provenance

File details

Details for the file PyGLM-0.4.3b1-cp35-cp35m-win_amd64.whl.

File metadata

File hashes

Hashes for PyGLM-0.4.3b1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 53a45f5eac478595c61fce0ad3c7feb7fc08e07a8aa44795a2da8aaa93469e65
MD5 e9159312f12538f1dc39074df92ca571
BLAKE2b-256 babeab49a066b91bfb127e2f584c3bd1d891072f0b0acb21475da9a3cd6b0a2b

See more details on using hashes here.

Provenance

File details

Details for the file PyGLM-0.4.3b1-cp35-cp35m-win32.whl.

File metadata

File hashes

Hashes for PyGLM-0.4.3b1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 ed9b72551078041d12cd8e6256083c3a1be2642e469e608a9822e5f8a6942e5e
MD5 74a38aca514ec76d27d4ddb39bb0f92e
BLAKE2b-256 1ef558229ed7612bd647a892066ac6bc469903be6794c690735c5e3a7790b42d

See more details on using hashes here.

Provenance

File details

Details for the file PyGLM-0.4.3b1-cp34-cp34m-win_amd64.whl.

File metadata

File hashes

Hashes for PyGLM-0.4.3b1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 5c2d0a74e72f9ef2a71be22d4a4bfc494acf06e4587dfb994b46e6bf6832cea0
MD5 41d22064443eb94edd9f270bf47b2e44
BLAKE2b-256 bd2fb6d43fabeca7cbd97ac27572e3fbf1da1d3d605c3468368006a2009d9d5e

See more details on using hashes here.

Provenance

File details

Details for the file PyGLM-0.4.3b1-cp34-cp34m-win32.whl.

File metadata

File hashes

Hashes for PyGLM-0.4.3b1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 a569ecba027b8e117142b61618dc338b4a6b2af3bb02760b307123779f8a40e9
MD5 b8511125b2df2ba6dc0e750ac1c2425a
BLAKE2b-256 7f5b08366a519aa2dde42b1a58babf23ff5216f65bab94e90a6596e79673c6a8

See more details on using hashes here.

Provenance

File details

Details for the file PyGLM-0.4.3b1-cp33-none-win_amd64.whl.

File metadata

File hashes

Hashes for PyGLM-0.4.3b1-cp33-none-win_amd64.whl
Algorithm Hash digest
SHA256 28defb45e715376e7ff235845d1c922c77e6ed4a91788e5b325d94060e909acc
MD5 bf7d9fe99cd1c0421731d4a6ac0b6d47
BLAKE2b-256 09a8ad3e7bc31c817f20d28932e1c5a424f20bde6cca35db8d955bce1ef6ffc2

See more details on using hashes here.

Provenance

File details

Details for the file PyGLM-0.4.3b1-cp33-none-win32.whl.

File metadata

File hashes

Hashes for PyGLM-0.4.3b1-cp33-none-win32.whl
Algorithm Hash digest
SHA256 403aadae7bd7b8c9ba6188c2d0572b12ca61a0079a4b66a789788cb6e25d51cc
MD5 fd8dfe81392283401c946c7a3007f37f
BLAKE2b-256 b9a347e88a2ca61b70f959473082ef550dddd3a7071e0da6e1b7eca26736c7b2

See more details on using hashes here.

Provenance

File details

Details for the file PyGLM-0.4.3b1-cp27-cp27m-win32.whl.

File metadata

File hashes

Hashes for PyGLM-0.4.3b1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 ae257a921515930661a5bd2fbf0e0cd29e21fdff5435c9be512e84566f94a1e3
MD5 3ff1988a3b483031eaa4215408716cd3
BLAKE2b-256 dbc0532bc128770351850c21ddbb7e4407e25771975a47a138f176ff3602007e

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page