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.4b1.tar.gz (112.3 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.6m Windows x86-64

PyGLM-0.4.4b1-cp36-cp36m-win32.whl (179.0 kB view details)

Uploaded CPython 3.6m Windows x86

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

Uploaded CPython 3.5m Windows x86-64

PyGLM-0.4.4b1-cp35-cp35m-win32.whl (179.0 kB view details)

Uploaded CPython 3.5m Windows x86

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

Uploaded CPython 3.4m Windows x86-64

PyGLM-0.4.4b1-cp34-cp34m-win32.whl (188.8 kB view details)

Uploaded CPython 3.4m Windows x86

PyGLM-0.4.4b1-cp33-none-win_amd64.whl (194.8 kB view details)

Uploaded CPython 3.3 Windows x86-64

PyGLM-0.4.4b1-cp33-none-win32.whl (189.2 kB view details)

Uploaded CPython 3.3 Windows x86

PyGLM-0.4.4b1-cp27-cp27m-win32.whl (149.3 kB view details)

Uploaded CPython 2.7m Windows x86

File details

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

File metadata

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

File hashes

Hashes for PyGLM-0.4.4b1.tar.gz
Algorithm Hash digest
SHA256 3756dd3320ef6fd7393c904d403bbd462ab7e7607d8f6eed3270817437912627
MD5 eeefb7390e0f90926e4e44f3e0fe9f55
BLAKE2b-256 c5dbfdafa93b78ba374b32c9d5009de3a8ab3a9f961fac75ad3f870e72cf473a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for PyGLM-0.4.4b1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 9afe7b310a67715129b58dfd79b8a0a25ea9000caaaa834e043bf8aa10f20a0f
MD5 8ef02ce9cb250ab68cb049c81c58f6e6
BLAKE2b-256 6f306d4d14cb33e60418177082f42f5458d8999e907bf070e94b5ace4c890682

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for PyGLM-0.4.4b1-cp36-cp36m-win32.whl
Algorithm Hash digest
SHA256 06dcf2713e33e48766d56373e75f84ac2facac6673cd20cfe531646dee8273e4
MD5 8519ccf49fa80652360291054a460106
BLAKE2b-256 189be25f2fbb12b672d958b345d600b3be8ab98538b160bfcd07528616542cb1

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for PyGLM-0.4.4b1-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 74d4cfbdae79e9032c9c8cfec76cea252f22ced2410229eaa46bf91dd2422f98
MD5 f6fb315448f5f5a39b5f68cd33a19a27
BLAKE2b-256 dd68e1ba198b5a997d5df2224393c65104c77580a5e480b63f12ed6ac335343a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for PyGLM-0.4.4b1-cp35-cp35m-win32.whl
Algorithm Hash digest
SHA256 c42fe74f40c0396265df3fab224d4d28f435aa42c96835632af8e5fa7b84de20
MD5 214c8d1b119411f8df9d59d770555dbd
BLAKE2b-256 e852aace26bf38a6e018130799a0bb5544bd45f267cf4d85b33ad243695cf5bd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for PyGLM-0.4.4b1-cp34-cp34m-win_amd64.whl
Algorithm Hash digest
SHA256 7a8970b4768b9fa57720bb3c0c58571cecc845aae8020df5ab76fd0a7cca968a
MD5 f298985cb6cb8e8d89aef1da4ef8f520
BLAKE2b-256 c456935e873acfa4ffb83fa7080129109b865ae6eabf66532e6c7cac7794c3e5

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for PyGLM-0.4.4b1-cp34-cp34m-win32.whl
Algorithm Hash digest
SHA256 6fbaca0bd61d0d14aa0da9d013f37ae9c040957aed6d92d8ace96d6b5557be83
MD5 b59dd57c6cc3c8975a366592d7920a93
BLAKE2b-256 a9b95b0358af4036c0feca032a27e32c78dca6403bfd95cbec00f20677f250b2

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for PyGLM-0.4.4b1-cp33-none-win_amd64.whl
Algorithm Hash digest
SHA256 2ed5c5d4371ae85e0159b8b5b40897124d603ff6e1dd1441f37f45f8910f0b18
MD5 14f828b20809a5558d4cccd0d2a93dd2
BLAKE2b-256 6c502cebc19f8c3b268ed63ef6ba231e5d70058e341e4163cd167218af8b52ab

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for PyGLM-0.4.4b1-cp33-none-win32.whl
Algorithm Hash digest
SHA256 95ef6e2a39df07cbe7fbcf046491ed3f0b4c85ce2fdf6e51df3988c1bd793bba
MD5 a91f250e0782d313e2445bbc5660112e
BLAKE2b-256 7bef0602687d59501bd27cb3941fe3891eb16c5f6e918b1b720d74b56c851b1a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for PyGLM-0.4.4b1-cp27-cp27m-win32.whl
Algorithm Hash digest
SHA256 0c2ebda3e8a253a469947da559247d5bb75237ad50114fd2673b5776b0d79066
MD5 31cc449fa580dc11ac087250dae12103
BLAKE2b-256 3a41580cdc176f7bb84cb177741a9f76f228b75165ff8a0856d4ffdfa115aeb4

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