Quote:Original post by Xeon06
Thanks I got my translation to work, However I'm still having trouble with the rotation. I'm trying to make it rotate around my camera view but it just rotates around 0, 0
glTranslatef(0.0f, 0.0f, 0.0f); glTranslatef(-x + (Window.width / 2), -y + (Window.height / 2), 0.0f);
First of all, this is not canceling the translation.
You are thinking like glTranslate moves the view to a specific coordinate. It doesn't.
It moves relative to the camera's current position.
I.e.
glTranslatef(5.0f, 0.0f, 0.0f);glTranslatef(5.0f, 0.0f, 0.0f);
Is equal to
glTranslatef(10.0f, 0.0f, 0.0f);
In order to reverse a single translation, you must glTranslate backwards.
glTranslatef(5.0f, 0.0f, 0.0f);glTranslatef(-5.0f, 0.0f, 0.0f);//Camera is at same position after these lines