Crates.io | cgmatrix |
lib.rs | cgmatrix |
version | 0.2.1 |
source | src |
created_at | 2019-04-10 04:33:13.058756 |
updated_at | 2019-04-10 12:24:39.120638 |
description | Simple matrix library for computer graphics in Rust. |
homepage | |
repository | https://github.com/likr/cgmatrix |
max_upload_size | |
id | 126929 |
size | 6,752 |
Simple matrix library for computer graphics in Rust
cgmatrix is a matrix library intended to use with OpenGL and WebGL. Matrices are represented as float arrays that can be directly passed to OpenGL and WebGL.
Add cgmatrix in your Cartgo.toml file.
[dependencies]
cgmatrix = "0.1"
And, in your rust code:
fn main() {
let camera = cgmatrix::viewing_matrix([0.0, 0.0, 200.0], [0.0, 1.0, 0.0], [0.0, 0.0, 0.0]);
let theta = 0.5;
let mv_matrix = cgmatrix::matmul(cgmatrix::rotate_x(theta), camera);
println!("{:?}", mv_matrix);
}
Following methods are supported in cgmatrix:
MIT