[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: OpenGL orthographic projection



Gregor Mückl wrote:

>     glMatrixMode(GL_MODELVIEW);
>     glLoadIdentity();
>     glPushMatrix();
>     glOrtho(-3,3,3,-3,-20,20);

You havn't set the projection matrix - so probably there is still a perspective
matrix there.

I would do this:

     glMatrixMode(GL_PROJECTION);
     glLoadIdentity();
     glOrtho(-3,3,3,-3,-20,20);
     glMatrixMode(GL_MODELVIEW);
     glLoadIdentity();

Also, you'll probably want to do a glDisable(GL_DEPTH_TEST) because
you probably still have it turned on from the 3D rendering part of your
code.

---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1@airmail.net>    WorkEmail: <sjbaker@link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net    http://tuxaqfh.sf.net
           http://tuxkart.sf.net http://prettypoly.sf.net
-----BEGIN GEEK CODE BLOCK-----
GCS d-- s:+ a+ C++++$ UL+++$ P--- L++++$ E--- W+++ N o+ K? w--- !O M-
V-- PS++ PE- Y-- PGP-- t+ 5 X R+++ tv b++ DI++ D G+ e++ h--(-) r+++ y++++
-----END GEEK CODE BLOCK-----