I saw some previous posts and explantations on the internet of glOrthof, but I just don't get it. I am watching the Stanford OpenGL ES lesson on Youtube and the following code came up:
This code draws a picture 1px by 1px in the bottom left hand corner of the screen. Why would it do this though? I thought this code would take the picture from (0,0) and stretch it across the entire screen because it specifies the plane as from 0 to the width of the screen and 0 to the height of the screen. Can someone please explain as simply as possible why it draws it as 1px by 1px in the bottom left hand corner. The full source code can be found on the Stanford website labeled as "openGLtransforms.zip":
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/node/79
(The file where this code appears is ESRenderer1.m)
Thanks!
Code:
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrthof(0, backingWidth, 0, backingHeight, -1, 1);
This code draws a picture 1px by 1px in the bottom left hand corner of the screen. Why would it do this though? I thought this code would take the picture from (0,0) and stretch it across the entire screen because it specifies the plane as from 0 to the width of the screen and 0 to the height of the screen. Can someone please explain as simply as possible why it draws it as 1px by 1px in the bottom left hand corner. The full source code can be found on the Stanford website labeled as "openGLtransforms.zip":
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/node/79
(The file where this code appears is ESRenderer1.m)
Thanks!