GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


Frustum problem by NULL
1
 
template <class T> view<T> &view<T>::Frustum(T Left,T Right,T Down,T Up,T Near,T Far){

    this->arrMat[0]=2*Near/(Right-Left);
    this->arrMat[1]=0;
    this->arrMat[2]=(Right+Left)/(Right-Left);
    this->arrMat[3]=0;
    this->arrMat[4]=0;
    this->arrMat[5]=2*Near/(Up-Down);
    this->arrMat[6]=(Up+Down)/(Up-Down);
    this->arrMat[7]=0;
    this->arrMat[8]=this->arrMat[9]=0;
    this->arrMat[10]=(Far+Near)/(Far-Near);
    this->arrMat[11]=2*Near*Far/(Far-Near);;
    this->arrMat[12]=0;
    this->arrMat[13]=0;
    this->arrMat[14]=-1;
    this->arrMat[15]=0;
    glMultMatrixf(this->arrMat);
    return *this;
}