I'm trying to understand why my rectangle moves in the opposite direction I want it to.
I have a float
for translation:
glTranslatef(translate_x, 0, 0);
if (Keyboard.isKeyDown(Keyboard.KEY_SPACE)) {
translate_x += 5;
}
This is the rectangle I'm drawing (I did use glpush
and -pop
):
glColor3f(250, 0, 0);
glBegin(GL_QUADS);
glVertex2i(400, 400); // Upper-left
glVertex2i(450, 400); // Upper-right
glVertex2i(450, 450); // Bottom-right
glVertex2i(400, 450); // Bottom-left
glEnd();
Whenever I press the spacebar, the rectangle moves to the opposite direction of where I want it to move. Why is this?