GlmSharp/GlmSharpCompat5/Mat4x4/decmat4.cs
/// <summary>
/// Creates a perspective transformation matrix.
/// </summary>
Creates a perspective transformation matrix.
Creates a perspective transformation matrix .
public static decmat4 Perspective(decimal fovy, decimal aspect, decimal zNear, decimal zFar)
        {
            var tanHalfFovy = Math.Tan((double)fovy / 2.0);
            var m = Zero;
            m.m00 = (decimal)( 1 / ((double)aspect * tanHalfFovy) );
            m.m11 = (decimal)( 1 / (tanHalfFovy) );
            m.m22 = (decimal)( -(zFar + zNear) / (zFar - zNear) );
            m.m23 = (decimal)( -1 );
            m.m32 = (decimal)( -(2 * zFar * zNear) / (zFar - zNear) );
            return m;
        }
public static decmat4 Perspective ( decimal fovy , decimal aspect , decimal zNear , decimal zFar ) { var tanHalfFovy = Math . Tan ( ( double ) fovy / 2.0 ) ; var m = Zero ; m . m00 = ( decimal ) ( 1 / ( ( double ) aspect * tanHalfFovy ) ) ; m . m11 = ( decimal ) ( 1 / ( tanHalfFovy ) ) ; m . m22 = ( decimal ) ( - ( zFar + zNear ) / ( zFar - zNear ) ) ; m . m23 = ( decimal ) ( - 1 ) ; m . m32 = ( decimal ) ( - ( 2 * zFar * zNear ) / ( zFar - zNear ) ) ; return m ; }
Creates a perspective transformation matrix.
Creates a perspective transformation matrix .
fovy
decimal
aspect
decimal
zNear
decimal
zFar
decimal