Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

perspective_lh

QVM: Quaternions, Vectors, Matrices

perspective_lh

#include <boost/qvm/mat_operations.hpp>

namespace boost
{
    namespace qvm
    {
        template 
        -unspecified-return-type
        perspective_lh( T fov_y, T aspect, T zn, T zf );
    }
}

Returns:

A 4x4 projection matrix of unspecified type of the following form:

xs             0              0                 0
0              ys             0                 0
0              0         zf/(zf-zn)   -zn*zf/(zf-zn)
0              0              1                 0

where ys=cot(fov_y/2) and xs=ys/aspect.