summaryrefslogtreecommitdiffstats
path: root/graphics/src
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/src')
-rw-r--r--graphics/src/transformation.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/graphics/src/transformation.rs b/graphics/src/transformation.rs
index ff3b1d00..2ae74134 100644
--- a/graphics/src/transformation.rs
+++ b/graphics/src/transformation.rs
@@ -1,4 +1,4 @@
-use glam::{Mat4, Vec3, Vec4};
+use glam::{Mat4, Vec3};
use std::ops::Mul;
/// A 2D transformation matrix.
@@ -14,12 +14,7 @@ impl Transformation {
/// Creates an orthographic projection.
#[rustfmt::skip]
pub fn orthographic(width: u32, height: u32) -> Transformation {
- Transformation(Mat4::from_cols(
- Vec4::new(2.0 / width as f32, 0.0, 0.0, 0.0),
- Vec4::new(0.0, -2.0 / height as f32, 0.0, 0.0),
- Vec4::new(0.0, 0.0, -1.0, 0.0),
- Vec4::new(-1.0, 1.0, 0.0, 1.0)
- ))
+ Transformation(Mat4::orthographic_rh_gl(0.0, width as f32, 0.0, height as f32, -1.0, 1.0))
}
/// Creates a translate transformation.