cgmatrix
Simple matrix library for computer graphics in Rust
About
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.
Usage
Add cgmatrix in your Cartgo.toml file.
[]
= "0.1"
And, in your rust code:
API
Following methods are supported in cgmatrix:
Matrix creation
- zeros()
- identity()
- rotate_x(theta)
- rotate_y(theta)
- translate(x, y, z)
- viewing_matrix(eye, up, target)
- orthogonal_matrix(left, right, top, bottom, near, far)
- perspective_matrix(fov, aspect, near, far)
Matrix multiplication
- matmul
Vector operation
- cross(v1, v2)
- normalize(v)
License
MIT