From e2736caff6d5b40a818feda1b9b0cfaca3c1b689 Mon Sep 17 00:00:00 2001 From: sebcrozet Date: Thu, 4 Oct 2018 20:44:34 +0200 Subject: [PATCH] Fix glm::perspective. Fix #423. --- nalgebra-glm/src/ext/matrix_clip_space.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nalgebra-glm/src/ext/matrix_clip_space.rs b/nalgebra-glm/src/ext/matrix_clip_space.rs index c0f3f128..813fe8fc 100644 --- a/nalgebra-glm/src/ext/matrix_clip_space.rs +++ b/nalgebra-glm/src/ext/matrix_clip_space.rs @@ -90,9 +90,13 @@ pub fn ortho(left: N, right: N, bottom: N, top: N, znear: N, zfar: N) - // unimplemented!() //} -/// Creates a matrix for a symmetric perspective-view frustum based on the right handedness and OpenGL near and far clip planes definition. -pub fn perspective(fovy: N, aspect: N, near: N, far: N) -> TMat4 { - Perspective3::new(fovy, aspect, near, far).unwrap() + +/// Creates a matrix for a perspective-view frustum based on the right handedness and OpenGL near and far clip planes definition. +/// +/// # Important note +/// The `aspect` and `fovy` argument are interchanged compared to the original GLM API. +pub fn perspective(aspect: N, fovy: N, near: N, far: N) -> TMat4 { + Perspective3::new(aspect, fovy, near, far).unwrap() } //pub fn perspective_fov(fov: N, width: N, height: N, near: N, far: N) -> TMat4 {