CSharpGL.glm.ortho C# (CSharp) Method

ortho() public static method

Creates a matrix for projecting two-dimensional coordinates onto the screen.

this equals ortho(left, right, bottom, top, -1, 1)

public static ortho ( float left, float right, float bottom, float top ) : CSharpGL.mat4
left float The left.
right float The right.
bottom float The bottom.
top float The top.
return CSharpGL.mat4
        public static mat4 ortho(float left, float right, float bottom, float top)
        {
            var result = mat4.identity();
            result[0, 0] = (2f) / (right - left);
            result[1, 1] = (2f) / (top - bottom);
            result[2, 2] = -(1f);
            result[3, 0] = -(right + left) / (right - left);
            result[3, 1] = -(top + bottom) / (top - bottom);
            return result;
        }

Same methods

glm::ortho ( float left, float right, float bottom, float top, float zNear, float zFar ) : CSharpGL.mat4