2 releases
0.1.1 | Apr 16, 2022 |
---|---|
0.1.0 | Apr 11, 2022 |
#555 in WebAssembly
32 downloads per month
Used in 2 crates
72KB
1.5K
SLoC
π Όππ ½ππ Ό
Rust Micro Library for 3D Math
Overview
munum
is a minimalistic numerical library for high-performance 3D math. This is a pure Rust no_std compatible port of the JavaScript / AssemblyScript version of munum: https://github.com/andykswong/munum
Install
[dependencies]
munum = "0.1.0"
Features:
std
- enablesstd
support. enabled by default.libm
- can be used instead ofstd
to enable trigonometry related functions inno_std
environmentserde
- enablesserde
serialize/deserialize implementations
Documentation
See Docs.rs: https://docs.rs/munum
Usage
Sample usage to build a perspective camera view-projection matrix:
use core::f32::{consts::PI, INFINITY};
use munum::{transform, vec3};
let eye = vec3(0_f32, 2., 0.);
let target = vec3(0., 0.6, 0.);
let up = vec3(0., 0., -1.);
let view = transform::look_at(eye, target, up);
let proj = transform::perspective(2., PI/2., 1., INFINITY);
let view_proj = proj * view;
License
This repository and the code inside it is licensed under the MIT License. Read LICENSE for more information.
Dependencies
~375β780KB
~17K SLoC