Code:
void myglOrtho(GLfloat left,GLfloat right,GLfloat bottom,GLfloat top,GLfloat far,GLfloat near) { GLfloat a,b,c,d,e,f; a=left-right; b=left+right; c=bottom-top; d=bottom+top; e=far-near; f=far+near; GLfloat m[] = { (2.0f/-a), 0.0f, 0.0f, 0.0f, 0.0f, (2.0f/-c), 0.0f, 0.0f, 0.0f, 0.0f, (-2.0f/e), 0.0f, (b/a), (d/c), (-f/e), 1.0f }; glMatrixMode(GL_PROJECTION); glLoadIdentity(); glLoadMatrixf(m); }
Comment