public void perspective(float fovx, float aspect, float znear, float zfar){
	
		float e = 1.0f / (float)Math.tan(Math.toRadians((double)fovx) / 2.0f);
		float aspectInv = 1.0f / aspect;
		float fovy = (float) (2.0f * Math.atan(aspectInv / e));
		float xScale = (float) (1.0f / Math.tan(0.5f * fovy));
		float yScale = xScale / aspectInv;
		
	    m_projMatrix.m00 = xScale;
	    m_projMatrix.m01 = 0.0f;
	    m_projMatrix.m02 = 0.0f;
	    m_projMatrix.m03 = 0.0f;

	    m_projMatrix.m10 = 0.0f;
	    m_projMatrix.m11 = yScale;
	    m_projMatrix.m12 = 0.0f;
	    m_projMatrix.m13 = 0.0f;

	    m_projMatrix.m20 = 0.0f;
	    m_projMatrix.m21 = 0.0f;
	    m_projMatrix.m22 = (zfar + znear) / (znear - zfar);
	    m_projMatrix.m23 = -1.0f;

	    m_projMatrix.m30 = 0.0f;
	    m_projMatrix.m31 = 0.0f;
	    m_projMatrix.m32 = (2.0f * zfar * znear) / (znear - zfar);
	    m_projMatrix.m33 = 0.0f;

	    m_fovx = fovx;
	    m_znear = znear;
	    m_zfar = zfar;
		
	}