public mat4 perspective(float fovDegrees,float aspect,float near,float far){
  float t=near * (float)Math.tan((fovDegrees / 2.0f) * Math.PI / 180.0f);
  float b=-t;
  float r=aspect * t;
  float l=-r;
  float n=near;
  float f=far;
  float rl=r - l;
  float tb=t - b;
  float fn=f - n;
  float[] m=this.m;
  m[0]=(2.0f * n) / rl;
  m[1]=0.0f;
  m[2]=0.0f;
  m[3]=0.0f;
  m[4]=0.0f;
  m[5]=(2.0f * n) / tb;
  m[6]=0.0f;
  m[7]=0.0f;
  m[8]=(r + l) / rl;
  m[9]=(t + b) / tb;
  m[10]=-(f + n) / fn;
  m[11]=-1.0f;
  m[12]=0.0f;
  m[13]=0.0f;
  m[14]=-(2.0f * f * n) / fn;
  m[15]=0.0f;
  return this;
}

public mat4 perspective ( float fovDegrees , float aspect , float near , float far ) { float t = near * ( float ) Math . tan ( ( fovDegrees / 2.0f ) * Math . PI / 180.0f ) ; float b = - t ; float r = aspect * t ; float l = - r ; float n = near ; float f = far ; float rl = r - l ; float tb = t - b ; float fn = f - n ; float [ ] m = this . m ; m [ 0 ] = ( 2.0f * n ) / rl ; m [ 1 ] = 0.0f ; m [ 2 ] = 0.0f ; m [ 3 ] = 0.0f ; m [ 4 ] = 0.0f ; m [ 5 ] = ( 2.0f * n ) / tb ; m [ 6 ] = 0.0f ; m [ 7 ] = 0.0f ; m [ 8 ] = ( r + l ) / rl ; m [ 9 ] = ( t + b ) / tb ; m [ 10 ] = - ( f + n ) / fn ; m [ 11 ] = - 1.0f ; m [ 12 ] = 0.0f ; m [ 13 ] = 0.0f ; m [ 14 ] = - ( 2.0f * f * n ) / fn ; m [ 15 ] = 0.0f ; return this ; }
\ fn perspective \ brief replaces current matrix with a perspective matrix \ param fovdegrees [ float ] \ param aspect [ float ] \ param near [ float ] \ param far [ float ]
