PDA

View Full Version : x,y coordinates reversed???



robert
02-13-2001, 08:29 PM
for some reason my x and y coords are reversed, but not my z??

eg glTranslatef(0,5,0); will move down the coordinate system...

lee
02-13-2001, 09:02 PM
is your monitor upside down?
j/k....what other transformations have you performed in your program before this one

robert
02-13-2001, 09:27 PM
just glLoadIdentity();

Ill keep checking my code to see if i've mistakenly inverted something somewhere http://www.opengl.org/discussion_boards/ubb/tongue.gif

robert
02-13-2001, 09:28 PM
Here's my reshape func.

void reshape(int w, int h)
{
if (h==0) // Prevent A Divide By Zero By
{
h=1; // Making Height Equal One
}

glViewport(0, 0, (GLsizei)w, (GLsizei)h);

glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
glLoadIdentity(); // Reset The Projection Matrix

gluPerspective(45.0f,(GLfloat)w/(GLfloat)h,0.1f,200.0f);


glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
glLoadIdentity();

}

Elixer
02-13-2001, 09:41 PM
Well, since the "camera" is the inverse of what your actually doing, that is most likely the cause.

When you move left, the "camera" is moving right. (Sorta like a mirror)

robert
02-13-2001, 10:19 PM
thanks for your help. I just don't remember this happening in other programs, thats why i was confused. I'll just reverse my coords