πŸ…ΌπŸ†„πŸ…½πŸ†„πŸ…Ό

Rust Micro Library for 3D Math


License: MIT Crates.io Docs.rs build

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

toml [dependencies] munum = "0.1.0" Features: - std - enabled by default. - libm - can be used instead of std to enable trigonometry related functions in no_std environment - serde - enable serde serialize/deserialize implementations

Documentation

See Docs.rs: https://docs.rs/munum

Usage

Sample usage to build a perspective camera view-projection matrix:

```rust use core::f32::{consts::PI, INFINITY}; use munum::{transform, vec3};

let eye = vec3(0f32, 2., 0.); let target = vec3(0., 0.6, 0.); let up = vec3(0., 0., -1.); let view = transform::lookat(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.