PDA

View Full Version : glOrtho doesn't look right



croce
12-04-2003, 11:54 AM
hi,
I'm using glOrtho but the further from the eye the wider my objects are drawn.
see for example this picture: http://users.pandora.be/notfound/light10.gif
All angles are 90degrees, but they sure don't look like it.

Anyone has had a simular problem? anyone knows how to fix it?
tnx!


Initialisation goes something like this:


glViewport(0,0,width,height);

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-proj, proj,-proj, proj, proj, -proj);
glTranslatef(0,0,-proj);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

//p244
glEnable(GL_FOG);
glFogi(GL_FOG_MODE,GL_LINEAR);
GLfloat fogColor[4]={0.2,0.2,0.2,1.0};
glFogfv(GL_FOG_COLOR,fogColor);
glFogf(GL_FOG_DENSITY, 0.5 );
glFogf(GL_FOG_START, 0);
glFogf(GL_FOG_END, 1.5*proj);


Drawing goes like this:


glTranslatef(0,0,proj);
doLighting();
doDrawing();

Is there a better way to do the fog then de glTranslatef(0,0,-proj); and the glTranslatef(0,0,proj); ?
that's my way of trying to move the eyeplane but I'm not sure about that.


PS: I tryed changing near+far+depthclearcolor+depthfunction but doesn't make a difference to the odd perspective (that's good, cause it shouldn't make a difference)

I'll be glad to have a solution, cause this really bothers me http://www.opengl.org/discussion_boards/ubb/frown.gif

Mazy
12-04-2003, 12:47 PM
it doesn not becomes bigger further away ( measure the cornners ) but the eye think it should shrink the further away it is, and compensate for that, so when its not getting smaller, the eye corrects the similaruty and makes it look bigger.

croce
12-04-2003, 12:55 PM
You are saying: "it's all in the mind" ?

croce
12-04-2003, 12:58 PM
Tnx!!
I never would have guessed that!