# OpenGL coordinate question

This topic is 3794 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

##### Share on other sites
It sounds like you want an orthographic projection.

Take a look at glOrtho(). To get the effect you describe in your post, you would use it as follows:
glMatrixMode(GL_PROJECTION);glLoadIdentity();glOrtho(-1, 1, -1, 1, -1, 1);

##### Share on other sites
Quote:
 Original post by jykIt sounds like you want an orthographic projection.Take a look at glOrtho(). To get the effect you describe in your post, you would use it as follows:glMatrixMode(GL_PROJECTION);glLoadIdentity();glOrtho(-1, 1, -1, 1, -1, 1);

Thanks Jyk, I saw that in an allegro/OpenGL tutorial. When I change my Opengl init code to do that projection I still get weird results. Like translatf(0.5,0.5,1); makes my circle disappear from the screen completely (I set my screen res to 640x480 with sdl and disabled depth check). I will play around with it some more maybe I am just doing something stupid. Thanks for the help.

##### Share on other sites
Quote:
 Original post by jykIt sounds like you want an orthographic projection.Take a look at glOrtho(). To get the effect you describe in your post, you would use it as follows:glMatrixMode(GL_PROJECTION);glLoadIdentity();glOrtho(-1, 1, -1, 1, -1, 1);

Gah, I left in this line:

//gluPerspective(45.0f,(GLfloat)widthScreen/(GLfloat)heightScreen,0.1f,100.0f);

That was what screwed the whole thing up! Ah well, it made me read chapter 3 of the redbook again and I learned more about different projections. Thanks for the help.