Crates.io | ferrux_projection_matrix |
lib.rs | ferrux_projection_matrix |
version | 0.1.0 |
source | src |
created_at | 2022-04-13 14:38:43.927858 |
updated_at | 2022-04-13 14:38:43.927858 |
description | Perspective projection tool builder to help in 3D rendering calculations |
homepage | https://crates.io/crates/ferrux_projection_matrix |
repository | https://github.com/kriogenia/ferrux_projection_matrix |
max_upload_size | |
id | 567023 |
size | 20,496 |
Tool to ease the generation of perspective projection matrices to convert 3D vectors into their 2D projection.
To build the matrix just create a new Builder and set the properties that will define the projection matrix:
near
: Position of the near clip in the z-axis. By default 0.0
.far
: Position of the far clip in the z-axis. By default 1000.0
.fov
: Field of view in degrees. By default 90.0
.width
: Frame width. By default 1280
.height
: Frame height. By default 720
.let matrix = ferrux_projection_matrix::ProjectionMatrixBuilder::new()
.set_width(1920)
.set_height(1080)
.set_fov(100.0)
.set_far(2000.0)
.set_near(1.0)
.build();
println!("{matrix:?}");