Math library for game programming in python.
Project description
pyGameMath
Dependencies:
It uses six to allow support between python2.x and python3.x.
Install:
To install the library just do
pip install gem
It will install the dependicies automatically.
Documentation and Examples:
The examples on how to use the library and more info are maintained on the github wiki:
Supported features:
NxN Matrices:
Transpose
Scale
NxN Matrix Multiplication
NxN Matrix * N Dimensions Vector Multiplication
4x4 Perspective Projection Matrix
lookAt 4x4 Matrix
Translation (3x3, 4x4)
Rotation (2x2, 3x3, 4x4)
Shear (2x2, 3x3, 4x4)
Project
Unproject
Orthographic Projection
Perspective Projection
lookAt 4x4 matrix
Determinant 2x2, 3x3, 4x4
Inverse 2x2, 3x3, 4x4
N Dimensions Vectors:
Dot Product
Cross Product (3D, No 7D as of now)
2D get angle of vector
2D -90 degree rotation
2D +90 degree rotation
Refraction
Reflection
Negate
Normalize
Linear Interpolation
Max Vector/Scalar
Min Vector/Scalar
Clamp
Transform
Barycentric
isInSameDirection test
isInOppositeDirection test
3D Vector swizzling, similar to GLSL
3D Vector idenitities
Quaternions:
Normalize
Dot Product
Rotation
Conjugate
Inverse
Negate
Rotate X, Y, Z
Arbitary Axis Rotation
From angle Rotation
To Rotation Matrix (4x4)
From Rotation Matrix (4x4)
Cross Product
Vector3D, Scalar Multiplication
Logarithm
Exponential
Power
Liner Interpolation (LERP)
Spherical Interpolation (SLERP)
Spherical Interpoliaton No Invert
Quaternion Splines (SQUAD)
Plane:
Define using
3 Vectors
Point and Normal
Manual input
Dot Product
Normalize
Best fit normal and D value
Distance from plane to a point
Point location
Output
Flip
Ray:
Rotate using Matrix
Rotate using Quaternions
Translate
Output
Legendre Polynomial (Experimental, not complete):
For spherical harmonics
(l - m)PML(x) = x(2l - 1)PML-1(x
Irradiance maps
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
File details
Details for the file gem-v0.1.11.tar.gz
.
File metadata
- Download URL: gem-v0.1.11.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46563d196bd836fa67187563b0be01f3e63ecfbf4c9fca074e06750020d3d8b1 |
|
MD5 | 833d87207c4301a86608fc0b3854e0dc |
|
BLAKE2b-256 | 387a4d591fd8c80a536aeadc4e7f76e58f9cb43b422b86fda398bccde735af9c |