14 releases
| 0.3.0 | Aug 17, 2025 |
|---|---|
| 0.2.3 | Jan 26, 2017 |
| 0.2.1 | Oct 8, 2016 |
| 0.2.0 | Dec 13, 2015 |
| 0.1.0 | Feb 26, 2015 |
#36 in Graphics APIs
1,807 downloads per month
Used in 10 crates
(7 directly)
215KB
4K
SLoC
GLSL Mathematics for Rust.
Another Rust mathematics library for graphics applications.
Inspired by the great GLM library for C++, glm-rs
implements the data types, operators and built-in functions defined in GLSL
specification to help graphics programmers who are familiar with GLSL, so they
do not need to learn more than one math API.
Because of the not so small syntax/semantics difference between Rust and GLSL, some parts of GLSL are missing or changed, some functions are added to complete the functionalities. See the glm-rs documentation for full list of differences.
The project is in beta status until the major version reaches to 1.
Thanks
- GLM by G-Truc (Christophe Riccio). The implementation of noise functions are directly translated from GLM.
- Creators of the Rust for the language.
v0.3 (2025-08-17) Note
This version is a quick fix to let the crate work with new versions of Rust, with following PRs & issues resolved.
- Support Rust edition 2021 (#26, #30).
- Manually merged PR #29.
quickcheckis a dev-dependency now (#25).- Marked pack/unpack functions
unsafe(#27). - Constructor functions (e.g.,
vec3(..),mat4x3(...)) areconst(#31).
Breaking Change
-
GenNumdroppedRandtrait, which was removed in new versions ofrandcrate.Creating scalar and vector structs randomly with default distribution and range has few meanings in practice. So following statement does not compile anymore,
let _ = Vec3::rand();
Future Plan
-
no_stdsupport. - SIMD support.
- Quaternion.
- Re-design the generic scalar/vector types using the new Rust language features.
License
The MIT License (MIT)
Dependencies
~145KB