diff --git a/Libraries/Utilities/MatrixMath.js b/Libraries/Utilities/MatrixMath.js index addc8660e..32f3cd32f 100755 --- a/Libraries/Utilities/MatrixMath.js +++ b/Libraries/Utilities/MatrixMath.js @@ -67,8 +67,14 @@ var MatrixMath = { ]; }, + /** + * This create a perspective projection towards negative z + * Clipping the z range of [-near, -far] + * + * @param fovInRadians - field of view in randians + */ createPerspective: function(fovInRadians, aspect, near, far) { - var h = 1 / Math.tan(fovInRadians); + var h = 1 / Math.tan(fovInRadians / 2); var r_depth = 1 / (near - far); var C = (far + near) * r_depth; var D = 2 * (far * near * r_depth);