# glOrtho - Redbook - Woo's errata

Who is right?

Red book define ortho matrix this way:

Mat.Ind0 = 2.0f / (r - l);
Mat.Ind1 = 0.0f;
Mat.Ind2 = 0.0f;
Mat.Ind3 = 0.0f;
Mat.Ind4 = 0.0f;
Mat.Ind5 = 2.0f / (t - b);
Mat.Ind6 = 0.0f;
Mat.Ind7 = 0.0f;
Mat.Ind8 = 0.0f;
Mat.Ind9 = 0.0f;
Mat.IndA = -2.0f / (f - n);
Mat.IndB = 0.0f;
Mat.IndC = (r + l) / (r - l);
Mat.IndD = (t + b) / (t - b);
Mat.IndE = (f + n) / (f - n);
Mat.IndF = 1.0f;

Mason Woo’s errata and MSDN libray define it this way:

Mat.Ind0 = 2.0f / (r - l);
Mat.Ind1 = 0.0f;
Mat.Ind2 = 0.0f;
Mat.Ind3 = 0.0f;
Mat.Ind4 = 0.0f;
Mat.Ind5 = 2.0f / (t - b);
Mat.Ind6 = 0.0f;
Mat.Ind7 = 0.0f;
Mat.Ind8 = 0.0f;
Mat.Ind9 = 0.0f;
Mat.IndA = -2.0f / (f - n);
Mat.IndB = 0.0f;
Mat.IndC = -(r + l) / (r - l);
Mat.IndD = -(t + b) / (t - b);
Mat.IndE = -(f + n) / (f - n);
Mat.IndF = -1.0f;

But when you query a ortho matrix using glGetDoublev you get:

Mat.Ind0 = 2.0f / (r - l);
Mat.Ind1 = 0.0f;
Mat.Ind2 = 0.0f;
Mat.Ind3 = 0.0f;
Mat.Ind4 = 0.0f;
Mat.Ind5 = 2.0f / (t - b);
Mat.Ind6 = 0.0f;
Mat.Ind7 = 0.0f;
Mat.Ind8 = 0.0f;
Mat.Ind9 = 0.0f;
Mat.IndA = -2.0f / (f - n);
Mat.IndB = 0.0f;
Mat.IndC = -(r + l) / (r - l);
Mat.IndD = -(t + b) / (t - b);
Mat.IndE = -(f + n) / (f - n);
Mat.IndF = 1.0f;

Have you noticed that little minus missing at the 16th element?

My code is only working if I put 1… So why is evrybody else is saying that this should be -1 ?

[This message has been edited by Gabriel (edited 02-08-2001).]